Documentation
¶
Index ¶
- Constants
- func Do(req *http.Request) ([]byte, error)
- func ExtractArg1(jsonStr string) (string, error)
- func FormatString(input string) string
- func SubmitToolOutput(threadID, runID, toolCallID, output string) error
- func ToolFromTool(t tools.Tool) llms.Tool
- type Annotation
- type Assistant
- type AssistantOption
- func WithAssistantID(id string) AssistantOption
- func WithDescription(description string) AssistantOption
- func WithInstructions(instructions string) AssistantOption
- func WithMetadata(metadata map[string]string) AssistantOption
- func WithModel(model string) AssistantOption
- func WithName(name string) AssistantOption
- func WithTemperature(temperature float64) AssistantOption
- func WithToolResource(toolResource ToolResource) AssistantOption
- func WithTools(tools []tools.Tool) AssistantOption
- func WithTopP(topP float64) AssistantOption
- type AssistantResponse
- type Attachments
- type ChunkingStrategy
- type CodeInterpreter
- type CodeInterpreterToolResource
- type Content
- type ContentText
- type ContentTextValue
- type File
- type FileSearch
- type FileSearchToolResource
- type ImageFile
- type ImageURL
- type RankingOption
- type StaticChunkingStrategy
- type Tool
- type ToolCall
- type ToolFunction
- type ToolResource
- type ToolType
- type URL
- type VectorStore
Constants ¶
const BaseURL = "https://api.openai.com/v1"
Variables ¶
This section is empty.
Functions ¶
func ExtractArg1 ¶
func FormatString ¶ added in v0.0.7
FormatString formata uma string para atender aos requisitos: - Remove caracteres inválidos - Substitui espaços por "_" - Garante que o comprimento máximo seja de 64 caracteres
func SubmitToolOutput ¶
Types ¶
type Annotation ¶
type Assistant ¶
type Assistant struct { ID string `json:"id,omitempty"` Model string `json:"model"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Instructions string `json:"instructions,omitempty"` Tools *[]llms.Tool `json:"tools,omitempty"` ToolResource *ToolResource `json:"tool_resources,omitempty"` Temperature *float64 `json:"temperature,omitempty"` TopP *float64 `json:"top_p,omitempty"` Metadata map[string]string `json:"metadata,omitempty"` }
func NewAssistant ¶
func NewAssistant(opts ...AssistantOption) (*Assistant, error)
NewAssistant inicializa um novo assistente, opcionalmente com um ID de assistente existente.
func (*Assistant) DeleteAssistant ¶
func (a *Assistant) DeleteAssistant() (*AssistantResponse, error)
Delete an assistant.
func (*Assistant) ListAssistants ¶
Returns a list of assistants.
func (*Assistant) RetrieveAssistant ¶
Retrieve assistan
type AssistantOption ¶
type AssistantOption func(*Assistant)
Option define o tipo para opções funcionais para configurar o assistente.
func WithAssistantID ¶
func WithAssistantID(id string) AssistantOption
WithAssistantID configura o assistente com um ID existente.
func WithDescription ¶
func WithDescription(description string) AssistantOption
WithDescription configura a descrição do assistente.
func WithInstructions ¶
func WithInstructions(instructions string) AssistantOption
WithInstructions configura as instruções do assistente.
func WithMetadata ¶
func WithMetadata(metadata map[string]string) AssistantOption
WithMetadata configura os metadados do assistente.
func WithModel ¶
func WithModel(model string) AssistantOption
WithModel configura o modelo do assistente.
func WithTemperature ¶
func WithTemperature(temperature float64) AssistantOption
WithTemperature configura a temperatura do assistente.
func WithToolResource ¶
func WithToolResource(toolResource ToolResource) AssistantOption
WithToolResource configura o recurso da ferramenta do assistente.
func WithTools ¶
func WithTools(tools []tools.Tool) AssistantOption
WithTools configura as ferramentas do assistente.
func WithTopP ¶
func WithTopP(topP float64) AssistantOption
WithTopP configura o valor TopP do assistente.
type AssistantResponse ¶
type Attachments ¶
type ChunkingStrategy ¶
type ChunkingStrategy struct { Type string `json:"type"` Static StaticChunkingStrategy `json:"static"` }
type CodeInterpreter ¶
type CodeInterpreter struct {
Type string `json:"type"` //The type of tool being defined: code_interpreter
}
type CodeInterpreterToolResource ¶
type CodeInterpreterToolResource struct {
FileIDs []string `json:"file_ids"`
}
type Content ¶
type Content struct { Text ContentText `json:"text,omitempty"` ImageURL ImageURL `json:"image_url,omitempty"` ImageFile ImageFile `json:"image_file,omitempty"` }
type ContentText ¶
type ContentText struct { Type string `json:"type"` Text ContentTextValue `json:"text"` }
type ContentTextValue ¶
type ContentTextValue struct { Value string `json:"value"` Annotations []Annotation `json:"annotations"` }
type FileSearch ¶
type FileSearch struct { MaxNumResults int `json:"max_num_results"` RankingOption RankingOption `json:"ranking_option"` }
type FileSearchToolResource ¶
type FileSearchToolResource struct { VectorStoreIDs []string `json:"vector_store_ids,omitempty"` VectorStores []VectorStore `json:"vector_stores,omitempty"` }
type RankingOption ¶
type StaticChunkingStrategy ¶
type ToolCall ¶
type ToolCall struct { ID string `json:"id,omitempty"` Type ToolType `json:"type"` Function ToolFunction `json:"function,omitempty"` }
func ToolCallsFromToolCalls ¶
toolCallsFromToolCalls converts a slice of llms.ToolCall to a slice of ToolCall.
type ToolFunction ¶
type ToolResource ¶
type ToolResource struct { CodeInterpreter *CodeInterpreterToolResource `json:"code_interpreter,omitempty"` FileSearch *FileSearchToolResource `json:"file_search,omitempty"` }
type VectorStore ¶
type VectorStore struct { FileIDs []string `json:"file_ids,omitempty"` ChunkingStrategy ChunkingStrategy `json:"chunking_strategy,omitempty"` }