Documentation ¶
Index ¶
- Constants
- type AskSage
- func (s *AskSage) ChatCompletion(conversation ai.BotConversation, opts ...ai.LanguageModelOption) (*ai.TextStreamResult, error)
- func (s *AskSage) ChatCompletionNoStream(conversation ai.BotConversation, opts ...ai.LanguageModelOption) (string, error)
- func (s *AskSage) CountTokens(text string) int
- func (s *AskSage) GetDefaultConfig() ai.LLMConfig
- func (s *AskSage) TokenLimit() int
- type Client
- func (c *Client) FollowUpQuestions(params FollowUpParams) (*CompletionResponse, error)
- func (c *Client) GetDatasets() ([]Dataset, error)
- func (c *Client) GetPersonas() ([]Persona, error)
- func (c *Client) Login(params GetTokenParams) error
- func (c *Client) Query(params QueryParams) (*CompletionResponse, error)
- type CompletionResponse
- type Dataset
- type FollowUpParams
- type GetTokenParams
- type Message
- type Persona
- type QueryParams
- type TokenizerParams
Constants ¶
View Source
const ( ServerBaseURL = "https://server-nginx.asksage.ai" AuthBaseURL = "https://user-server-cac-gov.asksage.ai" RoleUser = "me" RoleGPT = "gpt" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AskSage ¶
type AskSage struct {
// contains filtered or unexported fields
}
func New ¶
func New(llmService ai.ServiceConfig) *AskSage
func (*AskSage) ChatCompletion ¶
func (s *AskSage) ChatCompletion(conversation ai.BotConversation, opts ...ai.LanguageModelOption) (*ai.TextStreamResult, error)
func (*AskSage) ChatCompletionNoStream ¶
func (s *AskSage) ChatCompletionNoStream(conversation ai.BotConversation, opts ...ai.LanguageModelOption) (string, error)
func (*AskSage) CountTokens ¶ added in v0.4.0
TODO: Implement actual token counting. For now just estimated based off OpenAI estimations
func (*AskSage) GetDefaultConfig ¶
func (*AskSage) TokenLimit ¶ added in v0.4.0
TODO: Figure out what the actual token limit is. For now just be conservative.
type Client ¶
func (*Client) FollowUpQuestions ¶
func (c *Client) FollowUpQuestions(params FollowUpParams) (*CompletionResponse, error)
func (*Client) GetDatasets ¶
func (*Client) GetPersonas ¶
func (*Client) Login ¶
func (c *Client) Login(params GetTokenParams) error
func (*Client) Query ¶
func (c *Client) Query(params QueryParams) (*CompletionResponse, error)
type CompletionResponse ¶
type FollowUpParams ¶
type FollowUpParams struct {
Message string `json:"message"`
}
type GetTokenParams ¶
type QueryParams ¶
type QueryParams struct { Message []Message `json:"message"` Persona string `json:"persona,omitempty"` SystemPrompt string `json:"system_prompt,omitempty"` Dataset string `json:"dataset,omitempty"` LimitReferences int `json:"limit_references,omitempty"` Temperature float64 `json:"temperature,omitempty"` Live int `json:"live,omitempty"` Model string `json:"model,omitempty"` }
type TokenizerParams ¶
Click to show internal directories.
Click to hide internal directories.