Skip to content

Commit

Permalink
Add conversation to helper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed Aug 8, 2023
1 parent ced2304 commit b68a975
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 11 deletions.
41 changes: 31 additions & 10 deletions agixtsdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b68a975

Please sign in to comment.