From b68a97564d9af20d09d1bba67a936ef41c4d22c1 Mon Sep 17 00:00:00 2001 From: Josh XT Date: Mon, 7 Aug 2023 23:38:23 -0400 Subject: [PATCH] Add conversation to helper functions --- agixtsdk/__init__.py | 41 +++++++++++++++++++++++++++++++---------- setup.py | 2 +- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/agixtsdk/__init__.py b/agixtsdk/__init__.py index aea454f..f9a3179 100644 --- a/agixtsdk/__init__.py +++ b/agixtsdk/__init__.py @@ -245,38 +245,59 @@ def prompt_agent( except Exception as e: return self.handle_error(e) - def instruct(self, agent_name: str, prompt: str) -> str: + def instruct(self, agent_name: str, user_input: str, conversation: str) -> str: return self.prompt_agent( agent_name=agent_name, prompt_name="instruct", - prompt_args={"user_input": prompt}, + prompt_args={ + "user_input": user_input, + "disable_memory": True, + "conversation_name": conversation, + }, ) - def chat(self, agent_name: str, prompt: str) -> str: + def chat( + self, + agent_name: str, + user_input: str, + conversation: str, + context_results: int = 4, + ) -> str: return self.prompt_agent( agent_name=agent_name, prompt_name="Chat", - prompt_args={"user_input": prompt, "context_reslts": 4}, + prompt_args={ + "user_input": user_input, + "context_results": context_results, + "conversation_name": conversation, + "disable_memory": True, + }, ) - def smartinstruct(self, agent_name: str, prompt: str) -> str: + def smartinstruct(self, agent_name: str, user_input: str, conversation: str) -> str: return self.run_chain( chain_name="Smart Instruct", - user_input=prompt, + user_input=user_input, agent_name=agent_name, all_responses=False, from_step=1, - chain_args={}, + chain_args={ + "conversation_name": conversation, + "disable_memory": True, + }, ) - def smartchat(self, agent_name: str, prompt: str) -> str: + def smartchat(self, agent_name: str, user_input: str, conversation: str) -> str: return self.run_chain( chain_name="Smart Chat", - user_input=prompt, + user_input=user_input, agent_name=agent_name, all_responses=False, from_step=1, - chain_args={}, + chain_args={ + "conversation_name": conversation, + "disable_memory": True, + }, ) def get_commands(self, agent_name: str) -> Dict[str, Dict[str, bool]]: diff --git a/setup.py b/setup.py index 152f6b7..56f0253 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name="agixtsdk", - version="0.0.18", + version="0.0.19", description="The AGiXT SDK for Python.", long_description=long_description, long_description_content_type="text/markdown",