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"`
	System        string      `json:"system"`
	Messages      []Message   `json:"messages"`
	Temperature   float64     `json:"temperature"`
	Stream        bool        `json:"stream,omitempty"`
	StopSequences interface{} `json:"stop_sequences"`
}

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 ChatOverloadError

type ChatOverloadError struct {
	Type  string `json:"error"`
	Error map[string]string
}

type ClientChatError

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

ChatError represents a chat-related error.

type ContentBlockDelta

type ContentBlockDelta struct {
	Type  string            `json:"type"`
	Index int               `json:"index"`
	Delta map[string]string `json:"delta"`
}

type ContentBlockStop

type ContentBlockStop struct {
	Type  string `json:"type"`
	Index int    `json:"index"`
}

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

type StreamedResponse

type StreamedResponse struct {
	Data string `json:"data"`
}

type Usage

type Usage struct {
	InputTokens  int `json:"input_tokens"`
	OutputTokens int `json:"output_tokens"`
}

Jump to

Keyboard shortcuts

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