openai

package
v0.0.0-...-9b2621d Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompatibleSystem

func CompatibleSystem(session *Session)

Types

type Client

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

func New

func New(host, apiKey string, model Model) *Client

func (*Client) Chat

func (c *Client) Chat(ctx context.Context, userMessage string, session *Session) *Response

type CompatibleClient

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

func NewCompatible

func NewCompatible(host, apiKey string, model Model) *CompatibleClient

func (*CompatibleClient) Chart

func (c *CompatibleClient) Chart(ctx context.Context, userMessage string, session *Session) *Response

type Message

type Message struct {
	SystemMessage    string
	UserMessage      string
	AssistantMessage string
	ToolCallID       string
	ToolContent      string
}

type Model

type Model struct {
	Name             string
	Temperature      float64
	FrequencyPenalty float64
	PresencePenalty  float64
	Compatible       bool
}

type Response

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

func (*Response) Close

func (r *Response) Close()

func (*Response) Error

func (r *Response) Error() <-chan error

func (*Response) Fail

func (r *Response) Fail(err error)

func (*Response) Message

func (r *Response) Message() <-chan string

func (*Response) Stream

func (r *Response) Stream(msg string)

type Session

type Session struct {
	Prompt  string
	History []Message
	Tools   []tools.Tool
}

type Tool

type Tool struct {
	Name        string `xml:"name"`
	Description string `xml:"description"`
	Arguments   string `xml:"arguments"`
}

type ToolDefine

type ToolDefine struct {
	Tools []Tool `xml:"tools"`
}

type ToolUse

type ToolUse struct {
	Name      string `xml:"name"`
	Arguments string `xml:"arguments"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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