proto

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package proto shared protocol.

Index

Constants

View Source
const (
	RoleSystem    = "system"
	RoleUser      = "user"
	RoleAssistant = "assistant"
	RoleTool      = "tool"
)

Roles.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	Content string
}

Chunk is a streaming chunk of text.

type Conversation

type Conversation []Message

Conversation is a conversation.

func (Conversation) String

func (cc Conversation) String() string

type Function

type Function struct {
	Name      string
	Arguments []byte
}

Function is the function signature of a tool call.

type Message

type Message struct {
	Role      string
	Content   string
	ToolCalls []ToolCall
}

Message is a message in the conversation.

type Request

type Request struct {
	Messages            []Message
	API                 string
	Model               string
	User                string
	Tools               map[string][]mcp.Tool
	Temperature         *float64
	TopP                *float64
	TopK                *int64
	Stop                []string
	MaxTokens           *int64
	MaxCompletionTokens *int64
	ToolCaller          func(name string, data []byte) (string, error)
}

Request is a chat request.

type ToolCall

type ToolCall struct {
	ID       string
	Function Function
	IsError  bool
}

ToolCall is a tool call in a message.

type ToolCallStatus

type ToolCallStatus struct {
	Name string
	Err  error
}

ToolCallStatus is the status of a tool call.

func (ToolCallStatus) String

func (c ToolCallStatus) String() string

Jump to

Keyboard shortcuts

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