Skip to content

Commit

Permalink
add get conversations with ids
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed Jun 12, 2024
1 parent 8317da8 commit d011286
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions agixtsdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,7 @@ def get_agentconfig(self, agent_name: str) -> Dict[str, Any]:
return self.handle_error(e)

def get_conversations(self, agent_name: str = "") -> List[str]:
if agent_name == "":
url = f"{self.base_uri}/api/conversations"
else:
url = f"{self.base_uri}/api/{agent_name}/conversations"
url = f"{self.base_uri}/api/conversations"
try:
response = requests.get(
headers=self.headers,
Expand All @@ -222,6 +219,17 @@ def get_conversations(self, agent_name: str = "") -> List[str]:
except Exception as e:
return self.handle_error(e)

def get_conversations_with_ids(self) -> List[str]:
url = f"{self.base_uri}/api/conversations"
try:
response = requests.get(
headers=self.headers,
url=url,
)
return response.json()["conversations_with_ids"]
except Exception as e:
return self.handle_error(e)

def get_conversation(
self, agent_name: str, conversation_name: str, limit: int = 100, page: int = 1
) -> List[Dict[str, Any]]:
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.48",
version="0.0.49",
description="The AGiXT SDK for Python.",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit d011286

Please sign in to comment.