Documentation ¶
Index ¶
- Constants
- type BedRockClaudeChatMessage
- type BedRockClaudeMessageContent
- type BedrockClaudeResponse
- type ChainParams
- type ChainParamsStep
- type ChainResult
- type Config
- type GeneralChatCompletionMessage
- type Instant
- 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) RawRequest(ctx context.Context, messages []GeneralChatCompletionMessage) (string, error)
- func (s *Instant) RawRequestAWSBedrockClaude(ctx context.Context, messages []BedRockClaudeChatMessage) (string, error)
- func (s *Instant) RawRequestAzureOpenAI(ctx context.Context, messages []azopenai.ChatRequestMessageClassification) (string, error)
- func (s *Instant) RawRequestOpenAI(ctx context.Context, messages []openai.ChatCompletionMessage) (string, error)
- func (s *Instant) TwoSteps(ctx context.Context, outputFormat string, input, inst string) (*ChainResult, error)
Constants ¶
View Source
const ( ProviderAzure = "azure" ProviderOpenAI = "openai" ProviderBedrock = "bedrock" )
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 Provider string Debug bool }
type GeneralChatCompletionMessage ¶
func (GeneralChatCompletionMessage) Pretty ¶
func (m GeneralChatCompletionMessage) Pretty() string
type Instant ¶
type Instant struct {
// contains filtered or unexported fields
}
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 ¶
func (*Instant) OneTimeRequestJson ¶
func (*Instant) RawRequest ¶
func (*Instant) RawRequestAWSBedrockClaude ¶ added in v0.0.5
func (*Instant) RawRequestAzureOpenAI ¶
func (*Instant) RawRequestOpenAI ¶
Click to show internal directories.
Click to hide internal directories.