diff --git a/agixtsdk/__init__.py b/agixtsdk/__init__.py index f9a3179..3c42a99 100644 --- a/agixtsdk/__init__.py +++ b/agixtsdk/__init__.py @@ -143,11 +143,15 @@ def get_agentconfig(self, agent_name: str) -> Dict[str, Any]: except Exception as e: return self.handle_error(e) - def get_conversations(self, agent_name: str) -> List[str]: + 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" try: response = requests.get( headers=self.headers, - url=f"{self.base_uri}/api/{agent_name}/conversations", + url=url, ) return response.json()["conversations"] except Exception as e: @@ -639,3 +643,24 @@ def learn_file(self, agent_name: str, file_name: str, file_content: str) -> str: return response.json()["message"] except Exception as e: return self.handle_error(e) + + def learn_github_repo( + self, + agent_name: str, + github_repo: str, + github_user: str = None, + github_token: str = None, + ): + try: + response = requests.post( + headers=self.headers, + url=f"{self.base_uri}/api/agent/{agent_name}/learn/github", + json={ + "github_repo": github_repo, + "github_user": github_user, + "github_token": github_token, + }, + ) + return response.json()["message"] + except Exception as e: + return self.handle_error(e) diff --git a/setup.py b/setup.py index 56f0253..589c203 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name="agixtsdk", - version="0.0.19", + version="0.0.20", description="The AGiXT SDK for Python.", long_description=long_description, long_description_content_type="text/markdown",