Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.3.1"
".": "0.4.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 3
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/agentbase%2Fagentbase-b248631a2800e6d0f22a253717a63a551d9305e4c990dceb2f5c5361c519fa24.yml
openapi_spec_hash: 4c06f6155fb614add9b30cd294266e11
config_hash: 2ad1177ae9ac1a57dc61c0f7e142fc06
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/agentbase%2Fagentbase-461274f650eccdf115b96ee1dbf1c0d4eb31485992cedc84ee0187aec72d63a5.yml
openapi_spec_hash: b8fa5fd0c89d9004d608af6061d0bf28
config_hash: 8d9b688cf969a1760b1300b65b80e796
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.4.0 (2025-10-11)

Full Changelog: [v0.3.1...v0.4.0](https://github.com/AgentbaseHQ/agentbase-python/compare/v0.3.1...v0.4.0)

### Features

* **api:** manual updates ([0dd1219](https://github.com/AgentbaseHQ/agentbase-python/commit/0dd12194314a6f967ee3ca879e3663da2b75a911))

## 0.3.1 (2025-10-11)

Full Changelog: [v0.3.0...v0.3.1](https://github.com/AgentbaseHQ/agentbase-python/compare/v0.3.0...v0.3.1)
Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ It is generated with [Stainless](https://www.stainless.com/).

## Documentation

The full API of this library can be found in [api.md](api.md).
The REST API documentation can be found on [docs.agentbase.sh](https://docs.agentbase.sh). The full API of this library can be found in [api.md](api.md).

## Installation

Expand Down Expand Up @@ -142,6 +142,22 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ

Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.

## Nested params

Nested parameters are dictionaries, typed using `TypedDict`, for example:

```python
from agentbase import Agentbase

client = Agentbase()

response = client.run_agent(
message="message",
callback={"url": "https://example.com"},
)
print(response.callback)
```

## Handling errors

When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `agentbase.APIConnectionError` is raised.
Expand Down
4 changes: 4 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ before making any information public.
If you encounter security issues that are not directly related to SDKs but pertain to the services
or products provided by Agentbase, please follow the respective company's security reporting guidelines.

### Agentbase Terms and Policies

Please contact team@agentbase.sh for any questions or concerns regarding the security of our services.

---

Thank you for helping us keep the SDKs and systems they interact with secure.
13 changes: 7 additions & 6 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,27 @@ Methods:

- <code title="post /">client.<a href="./src/agentbase/_client.py">run_agent</a>(\*\*<a href="src/agentbase/types/client_run_agent_params.py">params</a>) -> str</code>

# GetMessages
# Agent

Types:

```python
from agentbase.types import GetMessageRetrieveResponse
from agentbase.types import AgentRunResponse
```

Methods:

- <code title="post /get-messages">client.get_messages.<a href="./src/agentbase/resources/get_messages.py">retrieve</a>(\*\*<a href="src/agentbase/types/get_message_retrieve_params.py">params</a>) -> <a href="./src/agentbase/types/get_message_retrieve_response.py">GetMessageRetrieveResponse</a></code>
- <code title="post /">client.agent.<a href="./src/agentbase/resources/agent.py">run</a>(\*\*<a href="src/agentbase/types/agent_run_params.py">params</a>) -> str</code>

# ClearMessages
# Messages

Types:

```python
from agentbase.types import ClearMessageClearResponse
from agentbase.types import MessageClearResponse, MessageGetResponse
```

Methods:

- <code title="post /clear-messages">client.clear_messages.<a href="./src/agentbase/resources/clear_messages.py">clear</a>(\*\*<a href="src/agentbase/types/clear_message_clear_params.py">params</a>) -> <a href="./src/agentbase/types/clear_message_clear_response.py">ClearMessageClearResponse</a></code>
- <code title="post /clear-messages">client.messages.<a href="./src/agentbase/resources/messages.py">clear</a>(\*\*<a href="src/agentbase/types/message_clear_params.py">params</a>) -> <a href="./src/agentbase/types/message_clear_response.py">MessageClearResponse</a></code>
- <code title="post /get-messages">client.messages.<a href="./src/agentbase/resources/messages.py">get</a>(\*\*<a href="src/agentbase/types/message_get_params.py">params</a>) -> <a href="./src/agentbase/types/message_get_response.py">MessageGetResponse</a></code>
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[project]
name = "agentbase-sdk"
version = "0.3.1"
version = "0.4.0"
description = "The official Python library for the agentbase API"
dynamic = ["readme"]
license = "Apache-2.0"
authors = [
{ name = "Agentbase", email = "" },
{ name = "Agentbase", email = "team@agentbase.sh" },
]
dependencies = [
"httpx>=0.23.0, <1",
Expand Down
88 changes: 71 additions & 17 deletions src/agentbase/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from .resources import get_messages, clear_messages
from .resources import agent, messages
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
from ._exceptions import AgentbaseError, APIStatusError
from ._base_client import (
Expand All @@ -62,8 +62,8 @@


class Agentbase(SyncAPIClient):
get_messages: get_messages.GetMessagesResource
clear_messages: clear_messages.ClearMessagesResource
agent: agent.AgentResource
messages: messages.MessagesResource
with_raw_response: AgentbaseWithRawResponse
with_streaming_response: AgentbaseWithStreamedResponse

Expand Down Expand Up @@ -121,8 +121,8 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)

self.get_messages = get_messages.GetMessagesResource(self)
self.clear_messages = clear_messages.ClearMessagesResource(self)
self.agent = agent.AgentResource(self)
self.messages = messages.MessagesResource(self)
self.with_raw_response = AgentbaseWithRawResponse(self)
self.with_streaming_response = AgentbaseWithStreamedResponse(self)

Expand Down Expand Up @@ -202,12 +202,17 @@ def run_agent(
*,
message: str,
session: str | Omit = omit,
background: bool | Omit = omit,
callback: client_run_agent_params.Callback | Omit = omit,
datastores: Iterable[client_run_agent_params.Datastore] | Omit = omit,
final_output: client_run_agent_params.FinalOutput | Omit = omit,
mcp_servers: Iterable[client_run_agent_params.McpServer] | Omit = omit,
mode: Literal["flash", "fast", "max"] | Omit = omit,
queries: Iterable[client_run_agent_params.Query] | Omit = omit,
rules: SequenceNotStr[str] | Omit = omit,
streaming_tokens: bool | Omit = omit,
system: str | Omit = omit,
workflows: Iterable[client_run_agent_params.Workflow] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -231,21 +236,38 @@ def run_agent(
session: The session ID to continue the agent session conversation. If not provided, a
new session will be created.

background: Whether to run the agent asynchronously on the server. When set to true, use
callback parameter to receive events.

callback: A callback endpoint configuration to send agent message events back to. Use with
background true.

datastores: A set of datastores for the agent to utilize. Each object must include a `id`
and `name`.

final_output: Configuration for an extra final output event that processes the entire agent
message thread and produces a structured output based on the provided JSON
schema.

mcp_servers: A list of MCP server configurations. Each object must include a `serverName` and
`serverUrl`.

mode: The agent mode. Allowed values are `flash`, `fast` or `max`. Defaults to `fast`
if not supplied.

queries: A set of custom actions based on datastore (database) queries. Allows you to
quickly define actions that the agent can use to query your datastores.

rules: A list of constraints that the agent must follow.

streaming_tokens: Whether to stream the agent messages token by token.

system: A system prompt to provide system information to the agent.

workflows: A set of declarative workflows for the agent to execute. Each workflow is a DAG
(Directed Acyclic Graph) of steps that the agent interprets and executes
dynamically.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -260,12 +282,17 @@ def run_agent(
body=maybe_transform(
{
"message": message,
"background": background,
"callback": callback,
"datastores": datastores,
"final_output": final_output,
"mcp_servers": mcp_servers,
"mode": mode,
"queries": queries,
"rules": rules,
"streaming_tokens": streaming_tokens,
"system": system,
"workflows": workflows,
},
client_run_agent_params.ClientRunAgentParams,
),
Expand Down Expand Up @@ -316,8 +343,8 @@ def _make_status_error(


class AsyncAgentbase(AsyncAPIClient):
get_messages: get_messages.AsyncGetMessagesResource
clear_messages: clear_messages.AsyncClearMessagesResource
agent: agent.AsyncAgentResource
messages: messages.AsyncMessagesResource
with_raw_response: AsyncAgentbaseWithRawResponse
with_streaming_response: AsyncAgentbaseWithStreamedResponse

Expand Down Expand Up @@ -375,8 +402,8 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)

self.get_messages = get_messages.AsyncGetMessagesResource(self)
self.clear_messages = clear_messages.AsyncClearMessagesResource(self)
self.agent = agent.AsyncAgentResource(self)
self.messages = messages.AsyncMessagesResource(self)
self.with_raw_response = AsyncAgentbaseWithRawResponse(self)
self.with_streaming_response = AsyncAgentbaseWithStreamedResponse(self)

Expand Down Expand Up @@ -456,12 +483,17 @@ async def run_agent(
*,
message: str,
session: str | Omit = omit,
background: bool | Omit = omit,
callback: client_run_agent_params.Callback | Omit = omit,
datastores: Iterable[client_run_agent_params.Datastore] | Omit = omit,
final_output: client_run_agent_params.FinalOutput | Omit = omit,
mcp_servers: Iterable[client_run_agent_params.McpServer] | Omit = omit,
mode: Literal["flash", "fast", "max"] | Omit = omit,
queries: Iterable[client_run_agent_params.Query] | Omit = omit,
rules: SequenceNotStr[str] | Omit = omit,
streaming_tokens: bool | Omit = omit,
system: str | Omit = omit,
workflows: Iterable[client_run_agent_params.Workflow] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -485,21 +517,38 @@ async def run_agent(
session: The session ID to continue the agent session conversation. If not provided, a
new session will be created.

background: Whether to run the agent asynchronously on the server. When set to true, use
callback parameter to receive events.

callback: A callback endpoint configuration to send agent message events back to. Use with
background true.

datastores: A set of datastores for the agent to utilize. Each object must include a `id`
and `name`.

final_output: Configuration for an extra final output event that processes the entire agent
message thread and produces a structured output based on the provided JSON
schema.

mcp_servers: A list of MCP server configurations. Each object must include a `serverName` and
`serverUrl`.

mode: The agent mode. Allowed values are `flash`, `fast` or `max`. Defaults to `fast`
if not supplied.

queries: A set of custom actions based on datastore (database) queries. Allows you to
quickly define actions that the agent can use to query your datastores.

rules: A list of constraints that the agent must follow.

streaming_tokens: Whether to stream the agent messages token by token.

system: A system prompt to provide system information to the agent.

workflows: A set of declarative workflows for the agent to execute. Each workflow is a DAG
(Directed Acyclic Graph) of steps that the agent interprets and executes
dynamically.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -514,12 +563,17 @@ async def run_agent(
body=await async_maybe_transform(
{
"message": message,
"background": background,
"callback": callback,
"datastores": datastores,
"final_output": final_output,
"mcp_servers": mcp_servers,
"mode": mode,
"queries": queries,
"rules": rules,
"streaming_tokens": streaming_tokens,
"system": system,
"workflows": workflows,
},
client_run_agent_params.ClientRunAgentParams,
),
Expand Down Expand Up @@ -571,8 +625,8 @@ def _make_status_error(

class AgentbaseWithRawResponse:
def __init__(self, client: Agentbase) -> None:
self.get_messages = get_messages.GetMessagesResourceWithRawResponse(client.get_messages)
self.clear_messages = clear_messages.ClearMessagesResourceWithRawResponse(client.clear_messages)
self.agent = agent.AgentResourceWithRawResponse(client.agent)
self.messages = messages.MessagesResourceWithRawResponse(client.messages)

self.run_agent = to_raw_response_wrapper(
client.run_agent,
Expand All @@ -581,8 +635,8 @@ def __init__(self, client: Agentbase) -> None:

class AsyncAgentbaseWithRawResponse:
def __init__(self, client: AsyncAgentbase) -> None:
self.get_messages = get_messages.AsyncGetMessagesResourceWithRawResponse(client.get_messages)
self.clear_messages = clear_messages.AsyncClearMessagesResourceWithRawResponse(client.clear_messages)
self.agent = agent.AsyncAgentResourceWithRawResponse(client.agent)
self.messages = messages.AsyncMessagesResourceWithRawResponse(client.messages)

self.run_agent = async_to_raw_response_wrapper(
client.run_agent,
Expand All @@ -591,8 +645,8 @@ def __init__(self, client: AsyncAgentbase) -> None:

class AgentbaseWithStreamedResponse:
def __init__(self, client: Agentbase) -> None:
self.get_messages = get_messages.GetMessagesResourceWithStreamingResponse(client.get_messages)
self.clear_messages = clear_messages.ClearMessagesResourceWithStreamingResponse(client.clear_messages)
self.agent = agent.AgentResourceWithStreamingResponse(client.agent)
self.messages = messages.MessagesResourceWithStreamingResponse(client.messages)

self.run_agent = to_streamed_response_wrapper(
client.run_agent,
Expand All @@ -601,8 +655,8 @@ def __init__(self, client: Agentbase) -> None:

class AsyncAgentbaseWithStreamedResponse:
def __init__(self, client: AsyncAgentbase) -> None:
self.get_messages = get_messages.AsyncGetMessagesResourceWithStreamingResponse(client.get_messages)
self.clear_messages = clear_messages.AsyncClearMessagesResourceWithStreamingResponse(client.clear_messages)
self.agent = agent.AsyncAgentResourceWithStreamingResponse(client.agent)
self.messages = messages.AsyncMessagesResourceWithStreamingResponse(client.messages)

self.run_agent = async_to_streamed_response_wrapper(
client.run_agent,
Expand Down
2 changes: 1 addition & 1 deletion src/agentbase/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "agentbase"
__version__ = "0.3.1" # x-release-please-version
__version__ = "0.4.0" # x-release-please-version
Loading