Tinkex.API.Session (Tinkex v0.3.4)
View SourceSession management endpoints.
Uses :session pool (critical, keep-alive). Pool size: 5 connections with infinite idle time.
Summary
Functions
Create a new session.
Create a new session with typed response.
Send heartbeat to keep session alive.
Functions
@spec create( map(), keyword() ) :: {:ok, map()} | {:error, Tinkex.Error.t()}
Create a new session.
Examples
Tinkex.API.Session.create(
%{model_id: "...", config: %{}},
config: config
)
@spec create_typed( map(), keyword() ) :: {:ok, Tinkex.Types.CreateSessionResponse.t()} | {:error, Tinkex.Error.t()}
Create a new session with typed response.
Returns a properly typed CreateSessionResponse struct.
Examples
{:ok, response} = Tinkex.API.Session.create_typed(request, config: config)
response.session_id # => "session-abc-123"
@spec heartbeat( map(), keyword() ) :: {:ok, map()} | {:error, Tinkex.Error.t()}
Send heartbeat to keep session alive.