Documentation ¶
Index ¶
- func Setup(usage string) (string, ChatModelQuerier, PhotoQuerier, []string)
- type Chat
- type ChatCompletion
- type ChatCompletionChunk
- type ChatModelQuerier
- func (cq *ChatModelQuerier) Chat(ctx context.Context, API_KEY string, subCmd string, prompt []string) error
- func (cq *ChatModelQuerier) ConstructGlobMessages(globMessages []Message, args []string) ([]Message, error)
- func (cq *ChatModelQuerier) SaveAsPreviousQuery(msgs []Message) error
- func (cq *ChatModelQuerier) StreamCompletions(ctx context.Context, API_KEY string, messages []Message) (Message, error)
- type Choice
- type ImageResponse
- type ImageResponses
- type Message
- type PhotoQuerier
- type PromptConfig
- type Request
- type ResponseFormat
- type Usage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Setup ¶
func Setup(usage string) (string, ChatModelQuerier, PhotoQuerier, []string)
Types ¶
type Chat ¶
func ReadPreviousQuery ¶
type ChatCompletion ¶
type ChatCompletionChunk ¶
type ChatCompletionChunk struct { Id string `json:"id"` Object string `json:"object"` Created int `json:"created"` Model string `json:"model"` SystemFingerprint string `json:"system_fingerprint"` Choices []struct { Index int `json:"index"` Delta Message Logprobs interface{} `json:"logprobs"` FinishReason string `json:"finish_reason"` } `json:"choices"` }
type ChatModelQuerier ¶
type ChatModelQuerier struct { Model string `json:"model"` SystemPrompt string `json:"system_prompt"` Raw bool `json:"raw"` Url string `json:"url"` FrequencyPenalty float32 `json:"frequency_penalty"` MaxTokens *int `json:"max_tokens"` PresencePenalty float32 `json:"presence_penalty"` Temperature float32 `json:"temperature"` TopP float32 `json:"top_p"` ReplyMode bool // contains filtered or unexported fields }
func (*ChatModelQuerier) ConstructGlobMessages ¶
func (cq *ChatModelQuerier) ConstructGlobMessages(globMessages []Message, args []string) ([]Message, error)
func (*ChatModelQuerier) SaveAsPreviousQuery ¶
func (cq *ChatModelQuerier) SaveAsPreviousQuery(msgs []Message) error
func (*ChatModelQuerier) StreamCompletions ¶
func (cq *ChatModelQuerier) StreamCompletions(ctx context.Context, API_KEY string, messages []Message) (Message, error)
StreamCompletions taking the messages as prompt conversation. Returns the messages from the chat model.
type ImageResponse ¶
type ImageResponses ¶
type ImageResponses struct { Created int `json:"created"` Data []ImageResponse `json:"data"` }
type PhotoQuerier ¶
type PhotoQuerier struct { Model string `json:"model"` PhotoDir string `json:"photo-dir"` PhotoPrefix string `json:"photo-prefix"` PromptFormat string `json:"prompt-format"` // contains filtered or unexported fields }
func (*PhotoQuerier) QueryPhotoModel ¶
QueryPhotoModel using the supplied arguments as instructions
type PromptConfig ¶
type Request ¶
type Request struct { Model string `json:"model"` ResponseFormat ResponseFormat `json:"response_format"` Messages []Message `json:"messages"` Stream bool `json:"stream"` FrequencyPenalty float32 `json:"frequency_penalty"` MaxTokens *int `json:"max_tokens"` PresencePenalty float32 `json:"presence_penalty"` Temperature float32 `json:"temperature"` TopP float32 `json:"top_p"` }
type ResponseFormat ¶
type ResponseFormat struct {
Type string `json:"type"`
}
Click to show internal directories.
Click to hide internal directories.