pub struct OpenAiCompatApi { /* private fields */ }Expand description
OpenAI-compatible ChatCompletion endpoint
Implementations§
Source§impl OpenAiCompatApi
impl OpenAiCompatApi
Sourcepub async fn chat_completion(
&self,
body: &ChatCompletionRequest,
) -> Result<Value>
pub async fn chat_completion( &self, body: &ChatCompletionRequest, ) -> Result<Value>
OpenAI-compatible chat completion
Maps OpenAI ChatCompletion requests to UARP agent runs. The ‘model’ field maps to ‘agent/<agent_id>’ or a plain agent_id.
POST /v1/chat/completions
Required scopes: runs:create.
Sourcepub async fn create_response(
&self,
body: &CreateResponseRequest,
) -> Result<CreateResponseResponse>
pub async fn create_response( &self, body: &CreateResponseRequest, ) -> Result<CreateResponseResponse>
Create response (OpenAI Responses API)
OpenAI-compatible Responses API. model and input required; previous_response_id chains
to a prior response; instructions overrides the agent’s system prompt for this call.
POST /v1/responses
Required scopes: runs:create.
Sourcepub async fn embeddings(
&self,
body: &EmbeddingsRequest,
) -> Result<EmbeddingsResponse>
pub async fn embeddings( &self, body: &EmbeddingsRequest, ) -> Result<EmbeddingsResponse>
OpenAI-compatible embeddings
Generate embedding vectors for input text. Per Standats-Protocols §6.1. Uses platform-configured model (text-embedding-3-small).
POST /v1/embeddings
Required scopes: runs:create.
Sourcepub async fn get_response(&self, response_id: &str) -> Result<Value>
pub async fn get_response(&self, response_id: &str) -> Result<Value>
Get response by ID (OpenAI Responses API)
GET /v1/responses/{responseId}
Sourcepub async fn list_models(&self) -> Result<ListModelsResponse>
pub async fn list_models(&self) -> Result<ListModelsResponse>
List available models (OpenAI-compatible)
Returns agents as models in OpenAI model list format.
GET /v1/models
Trait Implementations§
Source§impl Clone for OpenAiCompatApi
impl Clone for OpenAiCompatApi
Source§fn clone(&self) -> OpenAiCompatApi
fn clone(&self) -> OpenAiCompatApi
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more