Skip to content

Commit 506308a

Browse files
authored
Merge pull request #31 from iamtekson/dev
fix package dependencies issues close #30
2 parents 28b15a4 + 3e783df commit 506308a

4 files changed

Lines changed: 15 additions & 8 deletions

File tree

geo_agent.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@
5050
SHOW_DEBUG_LOGS,
5151
)
5252
from .logger.logger import UILogHandler
53-
from .llm.client import create_llm, ollama_model_exists, ollama_pull_model
5453
from .llm.worker import LLMWorker
55-
from langchain_core.messages import AIMessage
5654
from .prompts.system import GENERAL_SYSTEM_PROMPT
5755
from .utils.canvas_refresh import (
5856
RefreshDispatcher,
@@ -374,14 +372,15 @@ def _ensure_dependencies_installed(self):
374372
data = tomllib.loads(content)
375373
deps = data.get("project", {}).get("dependencies", []) or []
376374
except Exception:
377-
m = re.search(r"dependencies\s*=\s*\[(.*?)\]", content, re.S)
375+
m = re.search(r"dependencies\s*=\s*\[(.*)\]", content, re.DOTALL)
378376
if m:
379377
raw = m.group(1)
380378
for line in raw.splitlines():
381379
line = line.strip().strip(",")
382380
if not line:
383381
continue
384-
if line.startswith('"') and line.endswith('"'):
382+
# handle both single and double quoted strings
383+
if (line.startswith('"') and line.endswith('"')) or (line.startswith("'") and line.endswith("'")):
385384
deps.append(line[1:-1])
386385
except Exception:
387386
deps = []
@@ -946,6 +945,14 @@ def _initialize_agent(
946945
max_tokens: Maximum tokens for response
947946
mode: Either 'general' or 'processing'
948947
"""
948+
try:
949+
from .llm.client import create_llm, ollama_model_exists, ollama_pull_model
950+
except Exception as e:
951+
self._log_error("_initialize_agent", e)
952+
raise RuntimeError(
953+
"Failed to import LLM client module. Ensure dependencies are installed."
954+
) from e
955+
949956
try:
950957
if model_name not in SUPPORTED_MODELS:
951958
raise ValueError(f"Unsupported model: {model_name}")

llm/worker.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from typing import Optional, Callable, Any
2-
from langchain_core.messages import BaseMessage, AIMessage
31
from qgis.PyQt.QtCore import QThread, pyqtSignal
42

53

metadata.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ qgisMinimumVersion=3.2
88
description=Plugin for QGIS interaction using LLM. Enables geospatial analysis and data processing through natural language commands.
99
version=0.1
1010
author=Tek Kshetri, Rabin Ojha
11-
email=iamtekson@gmail.com
11+
email=iamtekson@gmail.com, rabenojha@gmail.com
1212

1313
about=A QGIS plugin that leverages Large Language Models (LLMs) to facilitate geospatial analysis and data processing through natural language commands. GeoAgent integrates with QGIS to provide users with an intuitive interface for executing complex geospatial tasks using conversational AI.
1414
license=MIT
1515

1616
tracker=https://github.com/iamtekson/GeoAgent/issues
1717
repository=https://github.com/iamtekson/GeoAgent
1818
changelog=
19+
v0.1.1
20+
- Fixed dependency installation issues on some systems.
1921
v0.1
2022
- Initial release of GeoAgent plugin for QGIS.
2123
- Added support for Ollama, ChatGPT and Gemini LLMs.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "geo-agent"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
description = "Plugin for QGIS interaction using LLM. Enables geospatial analysis and data processing through natural language commands."
55
readme = "README.md"
66
requires-python = ">=3.13"

0 commit comments

Comments
 (0)