Documentation ¶
Index ¶
- Constants
- func Init(bc base.Component) *component
- type ChatMessage
- type ChatRequest
- type ChatResponse
- type GroqChatContent
- type GroqChatContentType
- type GroqChatMessage
- type GroqChatMessageInterface
- type GroqChoice
- type GroqClient
- type GroqClientInterface
- type GroqResponseMessage
- type GroqSystemMessage
- type GroqURL
- type GroqUsage
- type MultiModalContent
- type TaskTextGenerationChatInput
- type TaskTextGenerationChatOuput
- type TaskTextGenerationChatUsage
- type URL
Constants ¶
View Source
const (
Endpoint = "https://api.groq.com"
)
View Source
const (
TaskTextGenerationChat = "TASK_TEXT_GENERATION_CHAT"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChatMessage ¶
type ChatMessage struct { Role string `json:"role"` Content []MultiModalContent `json:"content"` }
type ChatRequest ¶
type ChatRequest struct { FrequencyPenalty float32 `json:"frequency_penalty,omitempty"` MaxTokens int `json:"max_tokens"` Model string `json:"model"` Messages []GroqChatMessageInterface `json:"messages"` N int `json:"n,omitempty"` PresencePenalty float32 `json:"presence_penalty,omitempty"` ParallelToolCalls bool `json:"parallel_tool_calls,omitempty"` Seed int `json:"seed,omitempty"` Stop []string `json:"stop"` Stream bool `json:"stream,omitempty"` Temperature float32 `json:"temperature,omitempty"` TopP float32 `json:"top_p,omitempty"` User string `json:"user,omitempty"` }
type ChatResponse ¶
type GroqChatContent ¶
type GroqChatContent struct { ImageURL *GroqURL `json:"image_url,omitempty"` Text string `json:"text"` Type GroqChatContentType `json:"type,omitempty"` }
type GroqChatContentType ¶
type GroqChatContentType string
const ( GroqChatContentTypeText GroqChatContentType = "text" GroqChatContentTypeImage GroqChatContentType = "image" )
type GroqChatMessage ¶
type GroqChatMessage struct { Role string `json:"role"` Content []GroqChatContent `json:"content"` }
type GroqChatMessageInterface ¶
type GroqChatMessageInterface interface { }
type GroqChoice ¶
type GroqChoice struct { Index int `json:"index"` Message GroqResponseMessage `json:"message"` FinishReason string `json:"finish_reason"` }
type GroqClient ¶
type GroqClient struct {
// contains filtered or unexported fields
}
func (*GroqClient) Chat ¶
func (c *GroqClient) Chat(request ChatRequest) (ChatResponse, error)
type GroqClientInterface ¶
type GroqClientInterface interface {
Chat(ChatRequest) (ChatResponse, error)
}
type GroqResponseMessage ¶
type GroqSystemMessage ¶
type MultiModalContent ¶
type TaskTextGenerationChatInput ¶
type TaskTextGenerationChatInput struct { ChatHistory []ChatMessage `json:"chat-history"` MaxNewTokens int `json:"max-new-tokens"` Model string `json:"model"` Prompt string `json:"prompt"` PromptImages []string `json:"prompt-images"` Seed int `json:"seed"` SystemMsg string `json:"system-message"` Temperature float32 `json:"temperature"` TopK int `json:"top-k"` // additional parameters TopP float32 `json:"top-p"` User string `json:"user"` }
type TaskTextGenerationChatOuput ¶
type TaskTextGenerationChatOuput struct { Text string `json:"text"` Usage TaskTextGenerationChatUsage `json:"usage"` }
Click to show internal directories.
Click to hide internal directories.