types

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientQuery

type ClientQuery struct {
	Prompt        string `json:"prompt"`
	MaxIterations int    `json:"maxIterations"`
	ModelName     string `json:"modelName"`
	Session       string `json:"session"`
}

type CoinCap

type CoinCap struct {
	Data struct {
		Symbol   string `json:"symbol"`
		PriceUsd string `json:"priceUsd"`
	} `json:"data"`
	Timestamp int64 `json:"timestamp"`
}

type GPTResponse

type GPTResponse interface {
	Type() string       // direct, array, image, audio, async
	Value() interface{} // string, []string
	CanReply() bool     // if true replyMenu need to be shown
}

type HttpJsonStreamElement

type HttpJsonStreamElement struct {
	Close    bool     `json:"close"`
	Message  string   `json:"message"`
	Stream   bool     `json:"stream"`
	StepType StepType `json:"stepType"`
	Source   Source   `json:"source"`
	Session  string   `json:"session"`
}

type RestrictConfig

type RestrictConfig struct {
	// Chats is a list of chats that are going to be affected
	// by either In or Out function.
	Usernames []string

	// In defines a function that will be called if the chat
	// of an update will be found in the Chats list.
	In tele.HandlerFunc

	// Out defines a function that will be called if the chat
	// of an update will NOT be found in the Chats list.
	Out tele.HandlerFunc
}

RestrictConfig defines config for Restrict middleware.

type Source

type Source struct {
	Name    string `json:"name"`
	Link    string `json:"link"`
	Summary string `json:"summary"`
}

type StepType

type StepType string
const (
	StepHandleAgentAction             StepType = "HandleAgentAction"
	StepHandleAgentFinish             StepType = "HandleAgentFinish"
	StepHandleChainEnd                StepType = "HandleChainEnd"
	StepHandleChainError              StepType = "HandleChainError"
	StepHandleChainStart              StepType = "HandleChainStart"
	StepHandleFinalAnswer             StepType = "HandleFinalAnswer"
	StepHandleLLMGenerateContentEnd   StepType = "HandleLLMGenerateContentEnd"
	StepHandleLLMGenerateContentStart StepType = "HandleLLMGenerateContentStart"
	StepHandleLlmEnd                  StepType = "HandleLlmEnd"
	StepHandleLlmError                StepType = "HandleLlmError"
	StepHandleLlmStart                StepType = "HandleLlmStart"
	StepHandleNewSession              StepType = "HandleNewSession"
	StepHandleOllamaStart             StepType = "HandleOllamaStart"
	StepHandleParseError              StepType = "HandleParseError"
	StepHandleRetrieverEnd            StepType = "HandleRetrieverEnd"
	StepHandleRetrieverStart          StepType = "HandleRetrieverStart"
	StepHandleSourceAdded             StepType = "HandleSourceAdded"
	StepHandleToolEnd                 StepType = "HandleToolEnd"
	StepHandleToolError               StepType = "HandleToolError"
	StepHandleToolStart               StepType = "HandleToolStart"
	StepHandleVectorFound             StepType = "HandleVectorFound"
)

type ToolCall

type ToolCall struct {
	ID       string                  `json:"id"`
	Type     string                  `json:"type"` // == 'function'
	Function openai.ToolCallFunction `json:"function"`
}

type ToolCalls

type ToolCalls []ToolCall

ToolCalls is a custom type that will allow us to implement the driver.Valuer and sql.Scanner interfaces on a slice of ToolCall.

func (*ToolCalls) Scan

func (tc *ToolCalls) Scan(value interface{}) error

Scan implements the sql.Scanner interface, allowing for converting a JSON string from the database back into the ToolCalls slice.

func (ToolCalls) Value

func (tc ToolCalls) Value() (driver.Value, error)

Value implements the driver.Valuer interface, allowing for converting the ToolCalls to a JSON string for database storage.

Jump to

Keyboard shortcuts

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