Struct CellstateClient
Source pub struct CellstateClient {
http: Client,
base_url: Url,
api_key: SecretString,
response_format: ResponseFormat,
}Fields§
§http: Client§base_url: Url§api_key: SecretString§response_format: ResponseFormatImplementations§
Source§impl CellstateClient
impl CellstateClient
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Create a client from environment variables.
Reads CELLSTATE_API_URL (or CELLSTATE_BASE_URL) and CELLSTATE_API_KEY.
§Errors
Returns Error::InvalidUrl if the URL env var is missing or invalid.
Sourcepub fn with_response_format(self, response_format: ResponseFormat) -> Self
pub fn with_response_format(self, response_format: ResponseFormat) -> Self
Returns a cloned client configured to request the given response format.
Sourcepub fn set_response_format(&mut self, response_format: ResponseFormat)
pub fn set_response_format(&mut self, response_format: ResponseFormat)
Set the preferred response format for this client.
Sourcefn auth(&self, builder: RequestBuilder) -> RequestBuilder
fn auth(&self, builder: RequestBuilder) -> RequestBuilder
Attach authentication and common headers to a request.
fn is_msgpack_content_type(content_type: &str) -> bool
async fn parse_response<T>(&self, response: Response) -> Result<T>where
T: DeserializeOwned,
Sourceasync fn send(&self, builder: RequestBuilder) -> Result<Response>
async fn send(&self, builder: RequestBuilder) -> Result<Response>
Execute a request and handle error responses.
Sourcepub async fn create_trajectory(
&self,
request: &CreateTrajectoryRequest,
) -> Result<TrajectoryResponse>
pub async fn create_trajectory( &self, request: &CreateTrajectoryRequest, ) -> Result<TrajectoryResponse>
Create a new trajectory.
Sourcepub async fn get_trajectory(
&self,
id: TrajectoryId,
) -> Result<TrajectoryResponse>
pub async fn get_trajectory( &self, id: TrajectoryId, ) -> Result<TrajectoryResponse>
Get a trajectory by ID.
Sourcepub async fn list_trajectories(
&self,
params: &ListParams,
) -> Result<ListResponse<TrajectoryResponse>>
pub async fn list_trajectories( &self, params: &ListParams, ) -> Result<ListResponse<TrajectoryResponse>>
List trajectories with optional pagination.
Sourcepub async fn update_trajectory(
&self,
id: TrajectoryId,
request: &UpdateTrajectoryRequest,
) -> Result<TrajectoryResponse>
pub async fn update_trajectory( &self, id: TrajectoryId, request: &UpdateTrajectoryRequest, ) -> Result<TrajectoryResponse>
Update a trajectory.
Sourcepub async fn delete_trajectory(&self, id: TrajectoryId) -> Result<()>
pub async fn delete_trajectory(&self, id: TrajectoryId) -> Result<()>
Delete a trajectory.
Sourcepub async fn create_scope(
&self,
request: &CreateScopeRequest,
) -> Result<ScopeResponse>
pub async fn create_scope( &self, request: &CreateScopeRequest, ) -> Result<ScopeResponse>
Create a new scope.
Sourcepub async fn get_scope(&self, id: ScopeId) -> Result<ScopeResponse>
pub async fn get_scope(&self, id: ScopeId) -> Result<ScopeResponse>
Get a scope by ID.
Sourcepub async fn list_scopes(
&self,
params: &ListParams,
) -> Result<ListResponse<ScopeResponse>>
pub async fn list_scopes( &self, params: &ListParams, ) -> Result<ListResponse<ScopeResponse>>
List scopes with optional pagination.
Sourcepub async fn update_scope(
&self,
id: ScopeId,
request: &UpdateScopeRequest,
) -> Result<ScopeResponse>
pub async fn update_scope( &self, id: ScopeId, request: &UpdateScopeRequest, ) -> Result<ScopeResponse>
Update a scope.
Sourcepub async fn delete_scope(&self, id: ScopeId) -> Result<()>
pub async fn delete_scope(&self, id: ScopeId) -> Result<()>
Delete a scope.
Sourcepub async fn create_artifact(
&self,
request: &CreateArtifactRequest,
) -> Result<ArtifactResponse>
pub async fn create_artifact( &self, request: &CreateArtifactRequest, ) -> Result<ArtifactResponse>
Create a new artifact.
Sourcepub async fn get_artifact(&self, id: ArtifactId) -> Result<ArtifactResponse>
pub async fn get_artifact(&self, id: ArtifactId) -> Result<ArtifactResponse>
Get an artifact by ID.
Sourcepub async fn list_artifacts(
&self,
params: &ListParams,
) -> Result<ListResponse<ArtifactResponse>>
pub async fn list_artifacts( &self, params: &ListParams, ) -> Result<ListResponse<ArtifactResponse>>
List artifacts with optional pagination.
Sourcepub async fn update_artifact(
&self,
id: ArtifactId,
request: &UpdateArtifactRequest,
) -> Result<ArtifactResponse>
pub async fn update_artifact( &self, id: ArtifactId, request: &UpdateArtifactRequest, ) -> Result<ArtifactResponse>
Update an artifact.
Sourcepub async fn delete_artifact(&self, id: ArtifactId) -> Result<()>
pub async fn delete_artifact(&self, id: ArtifactId) -> Result<()>
Delete an artifact.
Sourcepub async fn create_note(
&self,
request: &CreateNoteRequest,
) -> Result<NoteResponse>
pub async fn create_note( &self, request: &CreateNoteRequest, ) -> Result<NoteResponse>
Create a new note.
Sourcepub async fn get_note(&self, id: NoteId) -> Result<NoteResponse>
pub async fn get_note(&self, id: NoteId) -> Result<NoteResponse>
Get a note by ID.
Sourcepub async fn list_notes(
&self,
params: &ListParams,
) -> Result<ListResponse<NoteResponse>>
pub async fn list_notes( &self, params: &ListParams, ) -> Result<ListResponse<NoteResponse>>
List notes with optional pagination.
Sourcepub async fn update_note(
&self,
id: NoteId,
request: &UpdateNoteRequest,
) -> Result<NoteResponse>
pub async fn update_note( &self, id: NoteId, request: &UpdateNoteRequest, ) -> Result<NoteResponse>
Update a note.
Sourcepub async fn delete_note(&self, id: NoteId) -> Result<()>
pub async fn delete_note(&self, id: NoteId) -> Result<()>
Delete a note.
Sourcepub async fn create_turn(
&self,
request: &CreateTurnRequest,
) -> Result<TurnResponse>
pub async fn create_turn( &self, request: &CreateTurnRequest, ) -> Result<TurnResponse>
Create a new turn.
Sourcepub async fn get_turn(&self, id: TurnId) -> Result<TurnResponse>
pub async fn get_turn(&self, id: TurnId) -> Result<TurnResponse>
Get a turn by ID.
Sourcepub async fn list_turns(
&self,
params: &ListParams,
) -> Result<ListResponse<TurnResponse>>
pub async fn list_turns( &self, params: &ListParams, ) -> Result<ListResponse<TurnResponse>>
List turns with optional pagination.
Sourcepub async fn create_agent(
&self,
request: &CreateAgentRequest,
) -> Result<AgentResponse>
pub async fn create_agent( &self, request: &CreateAgentRequest, ) -> Result<AgentResponse>
Create a new agent.
Sourcepub async fn get_agent(&self, id: AgentId) -> Result<AgentResponse>
pub async fn get_agent(&self, id: AgentId) -> Result<AgentResponse>
Get an agent by ID.
Sourcepub async fn list_agents(
&self,
params: &ListParams,
) -> Result<ListResponse<AgentResponse>>
pub async fn list_agents( &self, params: &ListParams, ) -> Result<ListResponse<AgentResponse>>
List agents with optional pagination.
Sourcepub async fn commit_memory(
&self,
request: &CommitMemoryRequest,
) -> Result<CommitMemoryResponse>
pub async fn commit_memory( &self, request: &CommitMemoryRequest, ) -> Result<CommitMemoryResponse>
Commit a memory interaction (PCP memory commit).
Sourcepub async fn recall(&self, request: &RecallRequest) -> Result<RecallResponse>
pub async fn recall(&self, request: &RecallRequest) -> Result<RecallResponse>
Recall previous interactions for a trajectory.
Sourcepub async fn assemble_context(
&self,
request: &AssembleContextRequest,
) -> Result<AssembleContextResponse>
pub async fn assemble_context( &self, request: &AssembleContextRequest, ) -> Result<AssembleContextResponse>
Assemble a context window for a scope.
Trait Implementations§
Source§impl Clone for CellstateClient
impl Clone for CellstateClient
Source§fn clone(&self) -> CellstateClient
fn clone(&self) -> CellstateClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more