Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertPrompts ¶ added in v0.1.2
func ConvertPrompts(prompts []Prompt) []openai.ChatCompletionMessage
ConvertPrompts converts a slice of integration.Prompt to a slice of chatgpt.ChatMessage
func PromptToMessage ¶ added in v0.1.2
func PromptToMessage(prompt Prompt) openai.ChatCompletionMessage
PromptToMessage converts a prompt to a chatgpt.ChatMessage
Types ¶
type ChatGPT ¶
type ChatGPT struct { Prompts []Prompt // contains filtered or unexported fields }
func New ¶ added in v0.1.4
func New(options *NewChatGPTOptions) *ChatGPT
New creates a new ChatGPT instance
func (*ChatGPT) GetTools ¶ added in v0.1.4
func (chat *ChatGPT) GetTools() []openai.Tool
ChatGPT is a struct that represents a set of tools for ChatGPT
func (*ChatGPT) RegisterToolHandler ¶ added in v0.1.4
func (chat *ChatGPT) RegisterToolHandler(definition ToolerHandlerDefinion, handler func(common.User, map[string]any) (string, error))
RegisterToolHandler registers a tool handler
type NewChatGPTOptions ¶ added in v0.1.6
type NewChatGPTOptions struct { OpenAIKey string MaxHistoryLength int OpenAIModel string Prompts []Prompt }
NewChatGPTOptions are the options for creating a new ChatGPT instance
type ToolHandlerParameter ¶ added in v0.1.4
type ToolHandlerParameter struct { Name string Description string Type jsonschema.DataType Required bool }
ToolHandlerParameter is a struct that represents a tool handler parameter
type ToolerHandlerDefinion ¶ added in v0.1.4
type ToolerHandlerDefinion struct { Name string Description string Parameters []ToolHandlerParameter }
ToolerHandlerDefinion is a struct that represents a tool handler definition
Click to show internal directories.
Click to hide internal directories.