api

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: MIT Imports: 6 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 is an HTTP client for AgentAPI

func NewClient

func NewClient(port int) *Client

NewClient creates a new AgentAPI client

func (*Client) GetMessages

func (c *Client) GetMessages() ([]ConversationMessage, error)

GetMessages returns the conversation history

func (*Client) GetStatus

func (c *Client) GetStatus() (*Status, error)

GetStatus returns the current agent status

func (*Client) IsRunning

func (c *Client) IsRunning() (bool, error)

IsRunning returns true if the agent is currently processing

func (*Client) SendMessage

func (c *Client) SendMessage(content string, msgType string) error

SendMessage sends a message to the agent

func (*Client) WaitForHealthy

func (c *Client) WaitForHealthy(timeout time.Duration) error

WaitForHealthy waits until the agent responds to health checks

func (*Client) WaitForStable

func (c *Client) WaitForStable(timeout time.Duration) error

WaitForStable waits until the agent is in stable state

type ConversationMessage

type ConversationMessage struct {
	ID      int    `json:"id"`
	Role    string `json:"role"`
	Content string `json:"content"`
	Time    string `json:"time,omitempty"`
}

ConversationMessage represents a message in the conversation history

type Message

type Message struct {
	Content string `json:"content"`
	Type    string `json:"type"` // "user" or "raw"
}

Message represents a message to send to the agent

type MessagesResponse

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

MessagesResponse represents the response from GET /messages

type Status

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

Status represents the agent status response

Jump to

Keyboard shortcuts

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