Skip to content

Commit

Permalink
add persona functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed Nov 3, 2024
1 parent 1ffcf33 commit 8ed84ad
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions agixtsdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,31 @@ def rename_prompt(
except Exception as e:
return self.handle_error(e)

def get_persona(self, agent_name: str) -> Dict[str, Any]:
try:
response = requests.get(
headers=self.headers,
url=f"{self.base_uri}/api/agent/{agent_name}/persona",
)
if self.verbose:
parse_response(response)
return response.json()["persona"]
except Exception as e:
return self.handle_error(e)

def update_persona(self, agent_name: str, persona: str) -> str:
try:
response = requests.put(
f"{self.base_uri}/api/agent/{agent_name}/persona",
headers=self.headers,
json={"persona": persona},
)
if self.verbose:
parse_response(response)
return response.json()["message"]
except Exception as e:
return self.handle_error(e)

def get_extension_settings(self) -> Dict[str, Any]:
try:
response = requests.get(
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.71",
version="0.0.72",
description="The AGiXT SDK for Python.",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 8ed84ad

Please sign in to comment.