types

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatArgs

type ChatArgs struct {
	Model       string      `json:"model"`
	MaxTokens   int         `json:"max_tokens"`
	Messages    []Message   `json:"messages"`
	Temperature float64     `json:"temperature"`
	Stream      bool        `json:"stream,omitempty"`
	Stop        interface{} `json:"stop"`
}

type ChatCompletionChunk

type ChatCompletionChunk struct {
	ID                string   `json:"id"`
	Object            string   `json:"object"`
	Created           int64    `json:"created"`
	Model             string   `json:"model"`
	SystemFingerprint string   `json:"system_fingerprint"`
	Choices           []Choice `json:"choices"`
}

Define the data model

type ChatCompletionResponse

type ChatCompletionResponse struct {
	Content      []map[string]string `json:"content"`
	ID           string              `json:"id"`
	Model        string              `json:"model"`
	Role         string              `json:"role"`
	StopReason   string              `json:"stop_reason"`
	StopSequence string              `json:"stop_sequence"`
	Type         string              `json:"type"`
	Usage        map[string]int
}

type ChatError

type ChatError struct {
	Type  string `json:"type"`
	Error struct {
		Type    string `json:"type"`
		Message string `json:"message"`
	} `json:"error"`
}

type Choice

type Choice struct {
	Index        int     `json:"index"`
	Delta        Delta   `json:"delta"`
	LogProbs     *string `json:"logprobs"`
	FinishReason *string `json:"finish_reason"`
}

type ClientChatError

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

ChatError represents a chat-related error.

type Delta

type Delta struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type ErrorResponse

type ErrorResponse struct {
	Error struct {
		Message string `json:"message"`
		Type    string `json:"type"`
		Code    string `json:"code"`
	} `json:"error"`
}

type Message

type Message struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

Message is a message in a chat request

Jump to

Keyboard shortcuts

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