client

package
v1.158.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents an agentapi-proxy client

func NewClient

func NewClient(baseURL string) *Client

NewClient creates a new agentapi-proxy client

func (*Client) DeleteSession added in v0.11.0

func (c *Client) DeleteSession(ctx context.Context, sessionID string) (*DeleteResponse, error)

DeleteSession terminates and deletes a session

func (*Client) GetMessages

func (c *Client) GetMessages(ctx context.Context, sessionID string) (*MessagesResponse, error)

GetMessages retrieves conversation history from an agentapi session

func (*Client) GetStatus

func (c *Client) GetStatus(ctx context.Context, sessionID string) (*StatusResponse, error)

GetStatus retrieves the current agent status from an agentapi session

func (*Client) Search

func (c *Client) Search(ctx context.Context, status string) (*SearchResponse, error)

Search lists and filters sessions

func (*Client) SearchWithTags added in v0.5.0

func (c *Client) SearchWithTags(ctx context.Context, status string, tags map[string]string) (*SearchResponse, error)

SearchWithTags lists and filters sessions with tag support

func (*Client) SendMessage

func (c *Client) SendMessage(ctx context.Context, sessionID string, message *Message) (*MessageResponse, error)

SendMessage sends a message to an agentapi session

func (*Client) Start

func (c *Client) Start(ctx context.Context, req *StartRequest) (*StartResponse, error)

Start creates a new agentapi session

func (*Client) StreamEvents

func (c *Client) StreamEvents(ctx context.Context, sessionID string) (<-chan string, <-chan error)

StreamEvents subscribes to Server-Sent Events (SSE) from an agentapi session

type DeleteResponse added in v0.11.0

type DeleteResponse struct {
	Message   string `json:"message"`
	SessionID string `json:"session_id"`
}

DeleteResponse represents the response from deleting a session

type Message

type Message struct {
	Content   string    `json:"content"`
	Type      string    `json:"type"` // "user" or "raw"
	Role      string    `json:"role,omitempty"`
	Timestamp time.Time `json:"timestamp,omitempty"`
	ID        string    `json:"id,omitempty"`
}

Message represents an agentapi message

type MessageResponse

type MessageResponse struct {
	Message
}

MessageResponse represents the response from sending a message

type MessagesResponse

type MessagesResponse struct {
	Messages []Message `json:"messages"`
}

MessagesResponse represents the response from getting messages

type SearchResponse

type SearchResponse struct {
	Sessions []SessionInfo `json:"sessions"`
}

SearchResponse represents the response from searching sessions

type SessionInfo

type SessionInfo struct {
	SessionID string            `json:"session_id"`
	UserID    string            `json:"user_id"`
	Status    string            `json:"status"`
	StartedAt time.Time         `json:"started_at"`
	Port      int               `json:"port"`
	Tags      map[string]string `json:"tags,omitempty"`
}

SessionInfo represents information about a session

type StartRequest

type StartRequest struct {
	Environment map[string]string `json:"environment,omitempty"`
	Tags        map[string]string `json:"tags,omitempty"`
}

StartRequest represents the request body for starting a new agentapi server

type StartResponse

type StartResponse struct {
	SessionID string `json:"session_id"`
}

StartResponse represents the response from starting a new agentapi server

type StatusResponse

type StatusResponse struct {
	Status string `json:"status"` // "stable" or "running"
}

StatusResponse represents the agent status

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL