Skip to content

Commit

Permalink
MAde llm-change-agent an optional dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshdhgd committed Sep 5, 2024
1 parent 36e7acb commit 6e96ea5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ python = ">=3.9,<4.0.0"
oaklib = ">=0.5.0"
PyGithub = "^2.3.0"
setuptools = ">=70.1.1"
llm-change-agent = "^0.0.3"
llm-change-agent = {version="^0.0.4", optional=true}

[tool.poetry.group.dev.dependencies]
pytest = "^7.1.3"
Expand Down
12 changes: 10 additions & 2 deletions src/ontobot_change_agent/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@
from typing import TextIO, Union

import click
from llm_change_agent.cli import execute

try:
from llm_change_agent.cli import execute

llm_change_agent_available = True
except ImportError:
# Handle the case where the package is not installed
llm_change_agent_available = False


from ontobot_change_agent import __version__
from ontobot_change_agent.api import (
Expand Down Expand Up @@ -250,7 +258,7 @@ def process_issue(
formatted_body = "The following commands were executed: </br> "
KGCL_COMMANDS = _get_kgcl_commands(issue[BODY])

elif use_llm:
elif use_llm and llm_change_agent_available:
click.echo(f"Summoning llm-change-agent for {issue[TITLE]}")
with click.Context(execute) as ctx:
ctx.params["prompt"] = issue[BODY]
Expand Down

0 comments on commit 6e96ea5

Please sign in to comment.