From 90710454418c5c6c7372263d5de72ae9dc32efeb Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Thu, 5 Sep 2024 23:15:20 -0500 Subject: [PATCH] Added option to provide RAG docs --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- src/ontobot_change_agent/cli.py | 11 +++++++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/poetry.lock b/poetry.lock index 7a531ac..817122c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2226,13 +2226,13 @@ requests = "*" [[package]] name = "llm-change-agent" -version = "0.0.7" +version = "0.0.8" description = "llm-change-agent" optional = true python-versions = "<4.0,>=3.9" files = [ - {file = "llm_change_agent-0.0.7-py3-none-any.whl", hash = "sha256:e917ad7140c9bdc6e1aca693a2f86102989cbede5867a10506a66b1761ba21ba"}, - {file = "llm_change_agent-0.0.7.tar.gz", hash = "sha256:c4c032e3f5bffda0bd99a35961efbdc0274368fe7f79e32e91d641f5614e9ff3"}, + {file = "llm_change_agent-0.0.8-py3-none-any.whl", hash = "sha256:377843cbe9445997be2e6809a25dc0b1f18ee28613c5b43d7a035c685a0f0e32"}, + {file = "llm_change_agent-0.0.8.tar.gz", hash = "sha256:0f495c96118414b6aab4d02f958f377c52fd71fde17669a4292fa42616011cd4"}, ] [package.dependencies] @@ -5735,4 +5735,4 @@ llm = ["llm-change-agent"] [metadata] lock-version = "2.0" python-versions = ">=3.9,<4.0.0" -content-hash = "4c3f4d8532dc5477b008f2e1143a0c0ae89087ea86d6d54d6cd2d5cab632a16e" +content-hash = "4fc1793a8d62029b5b9a3a316fd30fa82ccac184c66b162f5f5838612f846dc6" diff --git a/pyproject.toml b/pyproject.toml index d08bf39..0494ff4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = {version = "^0.0.7", extras = ["llm"], optional = true} +llm-change-agent = {version = "^0.0.8", extras = ["llm"], optional = true} [tool.poetry.group.dev.dependencies] diff --git a/src/ontobot_change_agent/cli.py b/src/ontobot_change_agent/cli.py index acc333a..698cc98 100644 --- a/src/ontobot_change_agent/cli.py +++ b/src/ontobot_change_agent/cli.py @@ -149,8 +149,12 @@ def main(verbose: int, quiet: bool): llm_model_option = click.option( "--model", type=click.Choice(ALL_AVAILABLE_MODELS), help="Model to use for generation." ) - - +rag_docs_option = click.option( + "--rag-docs", + multiple=True, + default=[], + help=f"Paths to the docs directories, URLs, or lowercased ontology names.", +) @main.command() @repo_option @state_option @@ -216,6 +220,7 @@ def get_labels(repo: str, token: str): @use_llm_option @llm_provider_option @llm_model_option +@rag_docs_option def process_issue( input: str, repo: str, @@ -230,6 +235,7 @@ def process_issue( use_llm: bool = False, provider: str = None, model: str = None, + rag_docs: tuple[str] = None, ): """Run processes based on issue label. @@ -281,6 +287,7 @@ def process_issue( ctx.params["prompt"] = issue[BODY] ctx.params["provider"] = provider ctx.params["model"] = model + ctx.params["docs"] = rag_docs response = extract_commands(execute.invoke(ctx)) KGCL_COMMANDS = [ command.replace('"', "'") for command in ast.literal_eval(response)