Documentation
¶
Index ¶
- Constants
- type BedRockClaudeChatMessage
- type BedRockClaudeMessageContent
- type BedrockClaudeResponse
- type ChainParams
- type ChainParamsStep
- type ChainResult
- 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) (*ChainResult, 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) (*ChainResult, error)
- func (s *Instant) OneTimeRequest(ctx context.Context, content string) (string, error)
- func (s *Instant) OneTimeRequestJson(ctx context.Context, content string) (map[string]any, error)
- func (s *Instant) OpenAIRawRequest(ctx context.Context, messages []openai.ChatCompletionMessage) (string, error)
- func (s *Instant) RawRequest(ctx context.Context, messages []GeneralChatCompletionMessage) (*RawRequestResponse, error)
- func (s *Instant) RawRequestWithParams(ctx context.Context, messages []GeneralChatCompletionMessage, ...) (*RawRequestResponse, 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)
- func (s *Instant) TwoSteps(ctx context.Context, outputFormat string, input, inst string) (*ChainResult, error)
- type RawRequestResponse
- type SusanooTaskRequest
- type SusanooTaskResponse
- type SusanooTaskResultResponse
Constants ¶
View Source
const ( ProviderAzure = "azure" ProviderOpenAI = "openai" ProviderBedrock = "bedrock" ProviderSusanoo = "susanoo" )
View Source
const ( ChatMessageRoleUser = "user" ChatMessageRoleAssistant = "assistant" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 }
type ChainParamsStep ¶
type ChainResult ¶
type Config ¶
type Config struct { // openai OpenAIApiKey string OpenAIGptModel string OpenAIEmbeddingModel string // azure openai AzureOpenAIApiKey string AzureOpenAIEndpoint string AzureOpenAIGptDeploymentID string AzureOpenAIEmbeddingDeploymentID string // aws bedrock AwsKey string AwsSecret string AwsBedrockModelArn string AwsBedrockEmbeddingModelArn string // susanoo SusanooEndpoint 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 (*Instant) BedrockClaudeRawRequestAWS ¶ added in v0.0.9
func (*Instant) CallInChain ¶
func (s *Instant) CallInChain(ctx context.Context, params ChainParams) (*ChainResult, error)
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 (s *Instant) MultipleSteps(ctx context.Context, params ChainParams) (*ChainResult, error)
func (*Instant) OneTimeRequest ¶
@deprecated
func (*Instant) OneTimeRequestJson ¶
@deprecated
func (*Instant) OpenAIRawRequest ¶ added in v0.0.9
func (*Instant) RawRequest ¶
func (s *Instant) RawRequest(ctx context.Context, messages []GeneralChatCompletionMessage) (*RawRequestResponse, error)
func (*Instant) RawRequestWithParams ¶ added in v0.0.9
func (s *Instant) RawRequestWithParams(ctx context.Context, messages []GeneralChatCompletionMessage, params map[string]any) (*RawRequestResponse, error)
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 RawRequestResponse ¶ added in v0.0.9
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.