Skip to main content
Every public type is exported from the package root: from personaai import ... — both client classes, every resource client (sync and async), every TypedDict input/result type, the principal contexts, the chat types, and the error classes. There’s no separate submodule to remember — one import covers the client, every resource, and every type. This page documents all of them.
Unlike a validating model library (Pydantic, etc.), these types are plain TypedDicts — zero runtime behavior, purely for mypy/pyright support. Request bodies keep the API’s own camelCase field names (providerId, systemPrompt, …) even though method and parameter names are Pythonic snake_case.

Full export index

This table is generated from the package’s actual exports (v0.3.0) — nothing here is invented.

Principal context

ProjectMachineContext

Resolved from a bare Project credential — acting as the Project itself.

ProjectRuntimeContext

Resolved from a Project credential paired with x-persona-external-user-id (i.e. external_user_id was set on the client).

PrincipalContext

ProjectMachineContext | ProjectRuntimeContext — the return type of client.whoami().

Shared result types

PaginationInfo

PaginatedResult[T]

Returned by every paginated list() — Agents, Skills, Knowledge, MCPs, Threads, Files, Audit Logs. Not Providers (bare list[Provider]).

BulkDeleteResult / BulkDeleteFailure

Returned by every bulk_delete(ids). BulkDeleteFailure: {"id": str, "reason": str}.

ResourceUsage / ResourceUsageAgent

Returned by every get_usage(id). ResourceUsageAgent: {"_id": str, "name": str}.

Provider types

Provider

A Provider as returned by the API — apiKey is never included. Uses id, not _id (clean formatted DTO).

CreateProviderInput

Required: label, baseURL, apiKey (plaintext — encrypted at rest, never returned), defaultModel. Optional: isDefault (default False).

UpdateProviderInput

All fields optional — label?, baseURL?, apiKey?, defaultModel?, isDefault?; only what you pass is changed. apiKey replaces the stored key entirely; omit to leave it untouched.

ProviderModel

{"id": str} — a model id reported available by a Provider’s endpoint.

ProviderTestConnectionResult

{"success": bool, "message": str} — success: False means the endpoint rejected the credentials/URL (a result, not a thrown error).

Skill types

Skill

Raw Mongo shape — _id, not id.

SkillFile

SkillFileInput

{"path": str (req), "content": str (req), "mimeType"?: str} — the input form for creating files.

CreateSkillInput

Required: name, description, instructions. Optional: isPublic (default False), files: list[SkillFileInput].

UpdateSkillInput

All optional: name?, description?, instructions?, isPublic?, files? — files replaces the entire array (not a merge/append).

DiscoverSkillsParams

page? (default 1), limit? (default 20), search? (free-text vs name/description), scope: Literal["mine"] (restricts to the asserted external user’s own Skills — runtime context only).

Agent types

Agent

Raw Mongo shape — _id, not id.
skills/mcps/knowledgeBases are typed list[object] deliberately — the wire shape is genuinely different per call: bare id strings on create()/update()/list(), populated objects on get(). The SDK reflects that real difference rather than picking one shape and being wrong for the other calls.
{"website"?: str, "twitter"?: str, "github"?: str, "linkedin"?: str} — all optional.

AgentVisibility

Literal["private", "unlisted", "public"] — unlisted is reachable by direct link/id but excluded from public discovery listings.

AgentCategory

Literal["productivity", "coding", "creative", "research", "roleplay", "other"].

CreateAgentInput

Required: name, systemPrompt, providerId. Optional (with defaults where noted): description?, avatar?, tags?, tagline?, bio?, personalityTraits?, socialLinks?, modelName?, webSearchEnabled? (default False), visibility? (default 'private'), category? (default 'other'), skills?: list[str], mcps?: list[str], knowledgeBases?: list[str], isActive? (default True). See Agents.

UpdateAgentInput

All fields optional. Array fields replace entirely: skills?, mcps?, knowledgeBases? — not merges/appends.

DiscoverAgentsParams

page? (default 1), limit? (default 20), search? (free-text vs name/description/tagline), category?: AgentCategory, scope: Literal["mine"].

Knowledge types

KnowledgeBase

Raw Mongo shape — _id, not id.

KnowledgeDocument

{"fileName": str, "fileSize": int, "mimeType": str, "chunkCount": int, "uploadedAt": str} — one uploaded source document’s chunking summary.

CreateKnowledgeBaseInput

Required: name, providerId. Optional: description?, isPublic? (default False), embeddingModel? (default 'text-embedding-3-small'), chunkSize? (default 800), chunkOverlap? (default 100), topK? (default 5).

UpdateKnowledgeBaseInput

All optional. Does not retroactively re-embed existing documents when providerId/embeddingModel/chunkSize/chunkOverlap change.

DiscoverKnowledgeBasesParams

page?, limit?, search?, scope: Literal["mine"] — same semantics as DiscoverSkillsParams.

UploadFileInput

UploadDocumentsResult

DeleteDocumentResult

{"removedChunks": int, "remainingDocuments": int, "remainingChunks": int}.

KnowledgeSearchResult

MCP types

McpTransport

Literal["http", "sse"].

McpAuthType

Literal["none", "oauth", "apiKey"].

McpAuthMode

Literal["owner", "user"] — owner: one shared connection for the whole Project; user: each external user connects their own.

Mcp

Raw Mongo shape — _id, not id. Secrets are stripped: oauth/apiKeyEncrypted are replaced with hasApiKey/a summarized oauth object.

McpTool

{"name": str, "description": str}.

McpResourceSummary

{"uri": str, "name": str, "description": str, "mimeType": str}.

McpResourceTemplate

{"uriTemplate": str, "name": str, "description": str, "mimeType": str, "toolName": str} — a resource whose uri has placeholder params to fill before calling read_resource().

McpOAuthConfig

McpOAuthInput

{"clientId": str (req), "clientSecret": str (req), "scopes"?: list[str]}.

PartialMcpOAuthInput

{"clientId"?: str, "clientSecret"?: str, "scopes"?: list[str]} — used on updates (each field optional).

CreateMcpInput

Required: name, transport, url. Optional: description?, authType? (default 'none'), authMode? (default 'owner'), oauth? (required when authType: 'oauth' and useDynamicRegistration isn’t set), apiKey? (required when authType: 'apiKey'), useDynamicRegistration? (default False), isEnabled? (default True).

UpdateMcpInput

All optional: name?, description?, transport?, url?, authType?, authMode?, isEnabled?, useDynamicRegistration?, oauth?: PartialMcpOAuthInput, apiKey? (replaces the stored key entirely; omit to leave it untouched).

DiscoverMcpsParams

page?, limit?, search?, scope: Literal["mine"] — same semantics as DiscoverSkillsParams.

McpTestConnectionResult

{"tools": list[McpTool], "resources": list[McpResourceSummary], "resourceTemplates": list[McpResourceTemplate]}.

McpReadResourceResult

{"text": str, "mimeType": str}.

McpUserConnectionStatus

{"connected": bool} — whether the asserted external user has completed their per-user OAuth connection.

McpAuthorizeUrl

{"url": str} — redirect the browser here.

Thread types

Thread

Raw Mongo shape — _id, not id.

ThreadAgentRef

{"_id": str (req), "name": str (req), "slug": str (req), "avatar"?: str} — the populated agentId shape on list().

CreateThreadInput

{"agentId": str}.

UpdateThreadInput

{"title"?: str, "isArchived"?: bool} — all optional, only what you pass is changed.

ListThreadsParams

{"page"?: int, "limit"?: int} — defaults 1/20.

ThreadMessages

File types

PersonaFile

Clean formatted shape — id, not _id.

UploadFilePayload

{"filename": str (req), "content": bytes | BinaryIO (req), "contentType"?: str, "agentId"?: str, "threadId"?: str}.

ListFilesParams

{"page"?: int, "limit"?: int} — defaults 1/20.

Audit log types

AuditLogEntry

ListAuditLogsParams

{"page"?: int, "limit"?: int, "eventType"?: str} — eventType is an optional exact-match filter.

Chat types

AguiEvent

dict[str, Any] — a loose typing of an AG-UI protocol event. Every event has a "type" key (compare against the EventType constants) plus type-specific fields (delta, name, value, etc.). See Chat for the event-type table. (This SDK deliberately doesn’t depend on an AG-UI protocol package — see Chat for why.)

ChatMessageInput

{"role": Literal["user", "assistant"], "content": str} — plain text only; the SDK doesn’t yet support multi-part/multimodal content on the way in.

ChatResume

The shape you pass must match the pending interrupt’s kind (see ChatInterrupt): hitl expects {"decisions": [...]}, clarification expects {"answers": [...], "text": ...}.

ChatInterrupt

ChatResult

Undocumented-by-design

  • TransportConfig, SyncTransport, AsyncTransport, build_url, build_headers, decode_json_envelope, raise_for_non_json_error, error_from_response, split_buffer, decode_frame, _accumulate, and the _httpx_files/_upload_files/_upload_data helpers are internal — not exported from the package root; don’t rely on them.
  • The transports are not publicly reachable from a client (there’s no client.http escape hatch in this SDK). If you need an endpoint the SDK doesn’t wrap yet, use httpx directly against the API Reference endpoints.