Name | superagent-py JSON |
Version |
0.2.40
JSON |
| download |
home_page | None |
Summary | None |
upload_time | 2024-05-23 06:42:29 |
maintainer | None |
docs_url | None |
author | None |
requires_python | <4.0,>=3.8 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<div align="center">
# Superagent Python SDK 🥷
### The open framework for building AI Assistants
<p>
<img alt="PyPi" src="https://img.shields.io/pypi/v/fern-superagent.svg" />
<a href="https://buildwithfern.com/?utm_source=homanp/suepragent-py/readme">
<img alt="Fern" src="https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen" />
</a><img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/homanp/superagent-py" />
<img alt="GitHub Last Commit" src="https://img.shields.io/github/last-commit/homanp/superagent-py" />
<img alt="" src="https://img.shields.io/github/repo-size/homanp/superagent-py" />
<img alt="GitHub Issues" src="https://img.shields.io/github/issues/homanp/superagent-py" />
<img alt="GitHub Pull Requests" src="https://img.shields.io/github/issues-pr/homanp/superagent-py" />
<img alt="Github License" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
<img alt="Discord" src="https://img.shields.io/discord/1110910277110743103?label=Discord&logo=discord&logoColor=white&style=plastic&color=d7b023)](https://discord.gg/e8j7mgjDUK" />
</p>
</div>
-----
Superagent is an open source framework that enables any developer to integrate production ready AI Assistants into any application in a matter of minutes.
-----
## Installation
Add this dependency to your project's build file:
```bash
pip install superagent-py
# or
poetry add superagent-py
```
## Usage
```python
from superagent.client import Superagent
client = Superagent(token="API_TOKEN", base_url="https://api.beta.superagent.sh")
agent = client.agent.create(request={
"name": "My Agent",
"description": "My awesome agent",
"isActive": True,
"llmModel": "GPT_4_1106_PREVIEW",
"prompt": "You are a helpful assistant"
})
output = client.agent.invoke(
agent_id=agent.data.id,
input="Hi there!",
enable_streaming=False,
session_id="123"
)
print("Received response from superagent", agent.data)
```
## Async Client
```python
from superagent.client import AsyncSuperagent
agent = await client.agent.create(request={
"name": "My Agent",
"description": "My awesome agent",
"isActive": True,
"llmModel": "GPT_4_1106_PREVIEW",
"prompt": "You are a helpful assistant"
})
output = await client.agent.invoke(
agent_id=agent.data.id,
input="Hi there!",
enable_streaming=False,
session_id="123"
)
print("Received response from superagent", agent.data)
```
## Handling Exceptions
All exceptions thrown by the SDK will sublcass [moneykit.ApiError](./src/moneykit/core/api_error.py).
```python
from superagent.core import ApiError
try:
client.agents.get(agent_id="12312")
except APIError as e:
# handle any api related error
```
Error codes are as followed:
| Status Code | Error Type |
| ----------- | -------------------------- |
| 422 | `UnprocessableEntityError` |
## Acknowledgements
A special thanks to the [Fern](https://buildwithfern.com/) team for all support with the Superagent libraries and SDKs ❤️.
## Beta status
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning the package version to a specific version in your pyproject.toml file. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
## Contributing
While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!
On the other hand, contributions to the README are always very welcome!
Raw data
{
"_id": null,
"home_page": null,
"name": "superagent-py",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/54/23/b3e1064335d006df77dd6584db9d57a1f595831385c92fa5d88415b0df83/superagent_py-0.2.40.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n\n# Superagent Python SDK \ud83e\udd77\n\n### The open framework for building AI Assistants\n\n<p>\n<img alt=\"PyPi\" src=\"https://img.shields.io/pypi/v/fern-superagent.svg\" />\n<a href=\"https://buildwithfern.com/?utm_source=homanp/suepragent-py/readme\">\n <img alt=\"Fern\" src=\"https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen\" />\n </a><img alt=\"GitHub Contributors\" src=\"https://img.shields.io/github/contributors/homanp/superagent-py\" />\n<img alt=\"GitHub Last Commit\" src=\"https://img.shields.io/github/last-commit/homanp/superagent-py\" />\n<img alt=\"\" src=\"https://img.shields.io/github/repo-size/homanp/superagent-py\" />\n<img alt=\"GitHub Issues\" src=\"https://img.shields.io/github/issues/homanp/superagent-py\" />\n<img alt=\"GitHub Pull Requests\" src=\"https://img.shields.io/github/issues-pr/homanp/superagent-py\" />\n<img alt=\"Github License\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n<img alt=\"Discord\" src=\"https://img.shields.io/discord/1110910277110743103?label=Discord&logo=discord&logoColor=white&style=plastic&color=d7b023)](https://discord.gg/e8j7mgjDUK\" />\n</p>\n\n</div>\n\n-----\n\nSuperagent is an open source framework that enables any developer to integrate production ready AI Assistants into any application in a matter of minutes.\n\n-----\n\n## Installation\n\nAdd this dependency to your project's build file:\n\n```bash\npip install superagent-py\n# or\npoetry add superagent-py\n```\n\n## Usage\n\n```python\nfrom superagent.client import Superagent\n\nclient = Superagent(token=\"API_TOKEN\", base_url=\"https://api.beta.superagent.sh\")\n\nagent = client.agent.create(request={\n \"name\": \"My Agent\",\n \"description\": \"My awesome agent\",\n \"isActive\": True,\n \"llmModel\": \"GPT_4_1106_PREVIEW\",\n \"prompt\": \"You are a helpful assistant\"\n})\n\noutput = client.agent.invoke(\n agent_id=agent.data.id,\n input=\"Hi there!\",\n enable_streaming=False,\n session_id=\"123\"\n)\n\nprint(\"Received response from superagent\", agent.data)\n```\n\n## Async Client\n\n```python\nfrom superagent.client import AsyncSuperagent\n\nagent = await client.agent.create(request={\n \"name\": \"My Agent\",\n \"description\": \"My awesome agent\",\n \"isActive\": True,\n \"llmModel\": \"GPT_4_1106_PREVIEW\",\n \"prompt\": \"You are a helpful assistant\"\n})\n\noutput = await client.agent.invoke(\n agent_id=agent.data.id,\n input=\"Hi there!\",\n enable_streaming=False,\n session_id=\"123\"\n)\n\nprint(\"Received response from superagent\", agent.data)\n```\n\n## Handling Exceptions\n\nAll exceptions thrown by the SDK will sublcass [moneykit.ApiError](./src/moneykit/core/api_error.py).\n\n```python\nfrom superagent.core import ApiError\n\ntry:\n client.agents.get(agent_id=\"12312\")\nexcept APIError as e:\n # handle any api related error\n```\n\nError codes are as followed:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 422 | `UnprocessableEntityError` |\n\n## Acknowledgements\n\nA special thanks to the [Fern](https://buildwithfern.com/) team for all support with the Superagent libraries and SDKs \u2764\ufe0f.\n\n## Beta status\n\nThis SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning the package version to a specific version in your pyproject.toml file. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.\n\n## Contributing\n\nWhile we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!\n\nOn the other hand, contributions to the README are always very welcome!\n",
"bugtrack_url": null,
"license": null,
"summary": null,
"version": "0.2.40",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "59e43ed44db9d40f8b4044fcdc0221c09656421623cb019ab52a0e7e64f2004f",
"md5": "4046110a6441f538348a5fbaa8d607d1",
"sha256": "761aeb419161f79d5558d4e9fa46596309b37bd7154f5440987abeeeba5764f5"
},
"downloads": -1,
"filename": "superagent_py-0.2.40-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4046110a6441f538348a5fbaa8d607d1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 83581,
"upload_time": "2024-05-23T06:42:28",
"upload_time_iso_8601": "2024-05-23T06:42:28.252407Z",
"url": "https://files.pythonhosted.org/packages/59/e4/3ed44db9d40f8b4044fcdc0221c09656421623cb019ab52a0e7e64f2004f/superagent_py-0.2.40-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5423b3e1064335d006df77dd6584db9d57a1f595831385c92fa5d88415b0df83",
"md5": "f2623c170a1650215d05a9f3f2a0f69b",
"sha256": "1f57e8cc8eb5b7387abcfc2c5b786985624ce56cfc8341b4ef352607f7224998"
},
"downloads": -1,
"filename": "superagent_py-0.2.40.tar.gz",
"has_sig": false,
"md5_digest": "f2623c170a1650215d05a9f3f2a0f69b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 33057,
"upload_time": "2024-05-23T06:42:29",
"upload_time_iso_8601": "2024-05-23T06:42:29.924296Z",
"url": "https://files.pythonhosted.org/packages/54/23/b3e1064335d006df77dd6584db9d57a1f595831385c92fa5d88415b0df83/superagent_py-0.2.40.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-23 06:42:29",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "superagent-py"
}