chat

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatCompletionResponse added in v0.23.0

type ChatCompletionResponse struct {
	Content string `json:"content"`
}

ChatCompletionResponse represents the response from non-streaming chat completion

type ChatMessage

type ChatMessage struct {
	Role       string               `json:"role"` // "user", "assistant", "system", "tool"
	Content    string               `json:"content"`
	Timestamp  int64                `json:"timestamp"`
	ToolCalls  []mcpopenai.ToolCall `json:"tool_calls,omitempty"`
	ToolCallID string               `json:"tool_call_id,omitempty"`
}

type Service

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

func NewService

func NewService(cfg config.ChatConfig, mcpServer *mcp.Server) (*Service, error)

func (*Service) ChatCompletion added in v0.23.0

func (s *Service) ChatCompletion(ctx context.Context, messages []ChatMessage, user *model.User) (*ChatCompletionResponse, error)

ChatCompletion performs a non-streaming chat completion

func (*Service) GetAIClient added in v0.23.0

func (s *Service) GetAIClient() ai.Client

Jump to

Keyboard shortcuts

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