acp_sdk.client.client module

class acp_sdk.client.client.Client[source]

Bases: object

__init__(*, session_id=None, client=None, instrument=True, auth=None, params=None, headers=None, cookies=None, timeout=None, verify=True, cert=None, http1=True, http2=False, proxy=None, mounts=None, follow_redirects=False, limits=Limits(max_connections=100, max_keepalive_connections=20, keepalive_expiry=5.0), max_redirects=20, event_hooks=None, base_url='', transport=None, trust_env=True)[source]
Parameters:
  • session_id (UUID | None)

  • client (AsyncClient | None)

  • instrument (bool)

  • auth (Tuple[str | bytes, str | bytes] | Callable[[Request], Request] | Auth | None)

  • params (QueryParams | Mapping[str, str | int | float | bool | None | Sequence[str | int | float | bool | None]] | List[Tuple[str, str | int | float | bool | None]] | Tuple[Tuple[str, str | int | float | bool | None], ...] | str | bytes | None)

  • headers (Headers | Mapping[str, str] | Mapping[bytes, bytes] | Sequence[Tuple[str, str]] | Sequence[Tuple[bytes, bytes]] | None)

  • cookies (Cookies | CookieJar | Dict[str, str] | List[Tuple[str, str]] | None)

  • timeout (float | None | Tuple[float | None, float | None, float | None, float | None] | Timeout)

  • verify (SSLContext | str | bool)

  • cert (str | Tuple[str, str] | Tuple[str, str, str] | None)

  • http1 (bool)

  • http2 (bool)

  • proxy (URL | str | Proxy | None)

  • mounts (None | Mapping[str, AsyncBaseTransport | None])

  • follow_redirects (bool)

  • limits (Limits)

  • max_redirects (int)

  • event_hooks (None | Mapping[str, list[Callable[[...], Any]]])

  • base_url (URL | str)

  • transport (AsyncBaseTransport | None)

  • trust_env (bool)

Return type:

None

async agent(*, name)[source]
Parameters:

name (str)

Return type:

Agent

async agents()[source]
Return type:

AsyncIterator[Agent]

property client: AsyncClient
async ping()[source]
Return type:

bool

async run_async(input, *, agent)[source]
Parameters:
Return type:

Run

async run_cancel(*, run_id)[source]
Parameters:

run_id (UUID)

Return type:

Run

async run_events(*, run_id)[source]
Parameters:

run_id (UUID)

Return type:

AsyncIterator[RunCreatedEvent | RunInProgressEvent | MessageCreatedEvent | ArtifactEvent | MessagePartEvent | MessageCompletedEvent | RunAwaitingEvent | GenericEvent | RunCancelledEvent | RunFailedEvent | RunCompletedEvent]

async run_resume_async(await_resume, *, run_id)[source]
Parameters:
Return type:

Run

async run_resume_stream(await_resume, *, run_id)[source]
Parameters:
Return type:

AsyncIterator[RunCreatedEvent | RunInProgressEvent | MessageCreatedEvent | ArtifactEvent | MessagePartEvent | MessageCompletedEvent | RunAwaitingEvent | GenericEvent | RunCancelledEvent | RunFailedEvent | RunCompletedEvent]

async run_resume_sync(await_resume, *, run_id)[source]
Parameters:
Return type:

Run

async run_status(*, run_id)[source]
Parameters:

run_id (UUID)

Return type:

Run

async run_stream(input, *, agent)[source]
Parameters:
Return type:

AsyncIterator[RunCreatedEvent | RunInProgressEvent | MessageCreatedEvent | ArtifactEvent | MessagePartEvent | MessageCompletedEvent | RunAwaitingEvent | GenericEvent | RunCancelledEvent | RunFailedEvent | RunCompletedEvent]

async run_sync(input, *, agent)[source]
Parameters:
Return type:

Run

session(session_id=None)[source]
Parameters:

session_id (UUID | None)

Return type:

AsyncGenerator[Self]