Spatio.Api.Conversations (spatio_sdk v0.0.2)
API calls for all endpoints tagged Conversations.
Summary
Functions
Persist a new LLM conversation.
Soft-delete a conversation.
Fetch one conversation.
Fetch the most recently active conversation for a given context tag.
List messages in a conversation.
List the caller's persisted LLM conversations.
Append a message to a conversation.
Update conversation metadata (title, context, cwd, session_id, pinned).
Patch metadata on an existing message. Body must include the message id (path is the conversation id, not the message).
Functions
@spec create_conversation( Tesla.Env.client(), keyword() ) :: {:ok, Spatio.Model.Conversation.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Persist a new LLM conversation.
Parameters
connection(Spatio.Connection): Connection to serveropts(keyword): Optional parameters:body(CreateConversationRequest):
Returns
{:ok, Spatio.Model.Conversation.t}on success{:error, Tesla.Env.t}on failure
@spec delete_conversation(Tesla.Env.client(), String.t(), keyword()) :: {:ok, nil} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Soft-delete a conversation.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t):opts(keyword): Optional parameters
Returns
{:ok, nil}on success{:error, Tesla.Env.t}on failure
@spec get_conversation(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Spatio.Model.Conversation.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Fetch one conversation.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t):opts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.Conversation.t}on success{:error, Tesla.Env.t}on failure
@spec get_latest_conversation_for_context(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Spatio.Model.Conversation.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Fetch the most recently active conversation for a given context tag.
Parameters
connection(Spatio.Connection): Connection to servercontext(String.t):opts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.Conversation.t}on success{:error, Tesla.Env.t}on failure
@spec list_conversation_messages(Tesla.Env.client(), String.t(), keyword()) :: {:ok, [Spatio.Model.ConversationMessage.t()]} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
List messages in a conversation.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t):opts(keyword): Optional parameters:limit(integer())::before(String.t):
Returns
{:ok, [%ConversationMessage{}, ...]}on success{:error, Tesla.Env.t}on failure
@spec list_conversations( Tesla.Env.client(), keyword() ) :: {:ok, [Spatio.Model.Conversation.t()]} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
List the caller's persisted LLM conversations.
Parameters
connection(Spatio.Connection): Connection to serveropts(keyword): Optional parameters:context(String.t)::limit(integer()):
Returns
{:ok, [%Conversation{}, ...]}on success{:error, Tesla.Env.t}on failure
@spec save_conversation_message( Tesla.Env.client(), String.t(), Spatio.Model.SaveMessageRequest.t(), keyword() ) :: {:ok, Spatio.Model.ConversationMessage.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Append a message to a conversation.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t):save_message_request(SaveMessageRequest):opts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.ConversationMessage.t}on success{:error, Tesla.Env.t}on failure
@spec update_conversation( Tesla.Env.client(), String.t(), Spatio.Model.UpdateConversationRequest.t(), keyword() ) :: {:ok, Spatio.Model.Conversation.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Update conversation metadata (title, context, cwd, session_id, pinned).
Parameters
connection(Spatio.Connection): Connection to serverid(String.t):update_conversation_request(UpdateConversationRequest):opts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.Conversation.t}on success{:error, Tesla.Env.t}on failure
@spec update_conversation_message_metadata( Tesla.Env.client(), String.t(), Spatio.Model.UpdateMessageMetadataRequest.t(), keyword() ) :: {:ok, Spatio.Model.ConversationMessage.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Patch metadata on an existing message. Body must include the message id (path is the conversation id, not the message).
Parameters
connection(Spatio.Connection): Connection to serverid(String.t):update_message_metadata_request(UpdateMessageMetadataRequest):opts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.ConversationMessage.t}on success{:error, Tesla.Env.t}on failure