Documentation
¶
Index ¶
- Constants
- type AzureRawRequestOptions
- type BedRockClaudeChatMessage
- type BedRockClaudeMessageContent
- type BedrockClaudeResponse
- type ChainParams
- type ChainParamsStep
- type Config
- type GeneralChatCompletionMessage
- type Instant
- func (s *Instant) AzureOpenAIRawRequest(ctx context.Context, messages []azopenai.ChatRequestMessageClassification, ...) (string, error)
- func (s *Instant) BedrockClaudeRawRequestAWS(ctx context.Context, messages []BedRockClaudeChatMessage) (string, error)
- func (s *Instant) CallInChain(ctx context.Context, params ChainParams) (*Result, error)
- func (s *Instant) CreateEmbeddingAzureOpenAI(ctx context.Context, input []string) ([]float32, error)
- func (s *Instant) CreateEmbeddingBedrock(ctx context.Context, input []string) ([]float32, error)
- func (s *Instant) CreateEmbeddingOpenAI(ctx context.Context, input []string) ([]float32, error)
- func (s *Instant) GetEmbeddings(ctx context.Context, input []string) ([]float32, error)
- func (s *Instant) GrabJsonOutput(ctx context.Context, input string, outputKeys ...string) (map[string]any, error)
- func (s *Instant) GrabJsonOutputFromMd(ctx context.Context, input string, ptrOutput interface{}) error
- func (s *Instant) MultipleSteps(ctx context.Context, params ChainParams) (*Result, error)
- func (s *Instant) OneTimeRequestWithParams(ctx context.Context, content string, params map[string]any) (*Result, error)
- func (s *Instant) OpenAIRawRequest(ctx context.Context, messages []openai.ChatCompletionMessage, ...) (string, error)
- func (s *Instant) RawRequest(ctx context.Context, messages []GeneralChatCompletionMessage) (*Result, error)
- func (s *Instant) RawRequestWithParams(ctx context.Context, messages []GeneralChatCompletionMessage, ...) (*Result, error)
- func (s *Instant) SusanooCreateTask(ctx context.Context, task *SusanooTaskRequest) (string, error)
- func (s *Instant) SusanooFetchTaskResult(ctx context.Context, traceID string) (*SusanooTaskResultResponse, error)
- func (s *Instant) SusanooRawRequest(ctx context.Context, messages []GeneralChatCompletionMessage, ...) (*SusanooTaskResultResponse, error)
- type OpenAIRawRequestOptions
- type Result
- type SusanoParams
- type SusanoParamsConditions
- type SusanoParamsSearch
- type SusanooTaskRequest
- type SusanooTaskResponse
- type SusanooTaskResultResponse
Constants ¶
View Source
const ( ProviderAzure = "azure" ProviderOpenAI = "openai" ProviderBedrock = "bedrock" ProviderSusanoo = "susanoo" ProviderDeepseek = "deepseek" ProviderXAI = "xai" )
View Source
const ( ChatMessageRoleUser = "user" ChatMessageRoleAssistant = "assistant" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AzureRawRequestOptions ¶ added in v1.0.1
type AzureRawRequestOptions struct {
UseJSON bool
}
type BedRockClaudeChatMessage ¶ added in v0.0.5
type BedRockClaudeChatMessage struct { Role string `json:"role"` Content []BedRockClaudeMessageContent `json:"content"` }
type BedRockClaudeMessageContent ¶ added in v0.0.5
type BedrockClaudeResponse ¶ added in v0.0.5
type BedrockClaudeResponse struct { ID string `json:"id"` Type string `json:"type"` Role string `json:"role"` Model string `json:"model"` Content []BedRockClaudeMessageContent `json:"content"` StopReason string `json:"stop_reason"` StopSequence interface{} `json:"stop_sequence"` Usage map[string]int `json:"usage"` }
type ChainParams ¶
type ChainParams struct { Format string Steps []ChainParamsStep RawRequestParams map[string]any }
type ChainParamsStep ¶
type Config ¶
type Config struct { // openai OpenAIAPIBase string OpenAIAPIKey string OpenAIModel string OpenAIEmbeddingModel string // azure openai AzureOpenAIAPIKey string AzureOpenAIEndpoint string AzureOpenAIModel string AzureOpenAIEmbeddingModel string // aws bedrock AwsKey string AwsSecret string AwsBedrockModelArn string AwsBedrockEmbeddingModelArn string // susanoo SusanooAPIBase string SusanooAPIKey string Provider string Debug bool }
type GeneralChatCompletionMessage ¶
type GeneralChatCompletionMessage struct { Role string `json:"role"` Content string `json:"content"` }
func (GeneralChatCompletionMessage) Pretty ¶
func (m GeneralChatCompletionMessage) Pretty() string
type Instant ¶
type Instant struct {
// contains filtered or unexported fields
}
func (*Instant) AzureOpenAIRawRequest ¶ added in v0.0.9
func (s *Instant) AzureOpenAIRawRequest(ctx context.Context, messages []azopenai.ChatRequestMessageClassification, opts *AzureRawRequestOptions) (string, error)
func (*Instant) BedrockClaudeRawRequestAWS ¶ added in v0.0.9
func (*Instant) CallInChain ¶
func (*Instant) CreateEmbeddingAzureOpenAI ¶
func (*Instant) CreateEmbeddingBedrock ¶ added in v0.0.7
func (*Instant) CreateEmbeddingOpenAI ¶ added in v0.0.7
func (*Instant) GetEmbeddings ¶
func (*Instant) GrabJsonOutput ¶
func (*Instant) GrabJsonOutputFromMd ¶ added in v0.0.6
func (*Instant) MultipleSteps ¶
func (*Instant) OneTimeRequestWithParams ¶ added in v1.0.0
func (*Instant) OpenAIRawRequest ¶ added in v0.0.9
func (s *Instant) OpenAIRawRequest(ctx context.Context, messages []openai.ChatCompletionMessage, opts *OpenAIRawRequestOptions) (string, error)
func (*Instant) RawRequest ¶
func (*Instant) RawRequestWithParams ¶ added in v0.0.9
func (*Instant) SusanooCreateTask ¶ added in v0.0.9
func (*Instant) SusanooFetchTaskResult ¶ added in v0.0.9
func (*Instant) SusanooRawRequest ¶ added in v0.0.9
func (s *Instant) SusanooRawRequest(ctx context.Context, messages []GeneralChatCompletionMessage, params map[string]any) (*SusanooTaskResultResponse, error)
type OpenAIRawRequestOptions ¶ added in v1.0.1
type OpenAIRawRequestOptions struct {
UseJSON bool
}
type SusanoParams ¶ added in v1.0.0
type SusanoParams struct { Format string `json:"format"` Search SusanoParamsSearch `json:"search"` Conditions SusanoParamsConditions `json:"conditions"` }
func (*SusanoParams) ToMap ¶ added in v1.0.0
func (p *SusanoParams) ToMap() map[string]any
type SusanoParamsConditions ¶ added in v1.0.0
type SusanoParamsSearch ¶ added in v1.0.2
type SusanooTaskRequest ¶ added in v0.0.9
type SusanooTaskRequest struct { Messages []GeneralChatCompletionMessage `json:"messages"` Params map[string]any `json:"params"` }
type SusanooTaskResponse ¶ added in v0.0.9
type SusanooTaskResultResponse ¶ added in v0.0.9
type SusanooTaskResultResponse struct { Data struct { ID int `json:"id"` ProxyID int `json:"proxy_id"` Result map[string]any `json:"result"` Status int `json:"status"` TraceID string `json:"trace_id"` ScheduledAt string `json:"scheduled_at"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` PendingCount int `json:"pending_count"` } `json:"data"` Ts int `json:"ts"` }
Click to show internal directories.
Click to hide internal directories.