Documentation
¶
Overview ¶
Copyright 2024 The Dapr Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 The Dapr Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 The Dapr Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 The Dapr Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func CacheModel(ctx context.Context, ttl string, model llms.Model) (llms.Model, error)
- func GetAnthropicModel(metadataValue string) string
- func GetAzureOpenAIModel(metadataValue string) string
- func GetGoogleAIModel(metadataValue string) string
- func GetHuggingFaceModel(metadataValue string) string
- func GetMistralModel(metadataValue string) string
- func GetOllamaModel(metadataValue string) string
- func GetOpenAIModel(metadataValue string) string
- type Choice
- type Conversation
- type LangchainMetadata
- type Message
- type Metadata
- type Request
- type Response
- type Result
Constants ¶
const ( DefaultOpenAIModel = "gpt-5-nano" // Enable GPT-5 (Preview) for all clients DefaultAzureOpenAIModel = "gpt-4.1-nano" // Default Azure OpenAI model DefaultAnthropicModel = "claude-sonnet-4-20250514" DefaultGoogleAIModel = "gemini-2.5-flash-lite" DefaultMistralModel = "open-mistral-7b" DefaultHuggingFaceModel = "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B" DefaultOllamaModel = "llama3.2:latest" )
Exported default model constants for consumers of the conversation package. These are used as fallbacks when env vars and metadata are not set.
Variables ¶
This section is empty.
Functions ¶
func CacheModel ¶
CacheModel creates a prompt query cache with a configured TTL
func GetAnthropicModel ¶ added in v1.16.1
func GetAzureOpenAIModel ¶ added in v1.16.1
func GetGoogleAIModel ¶ added in v1.16.1
func GetHuggingFaceModel ¶ added in v1.16.1
func GetMistralModel ¶ added in v1.16.1
func GetOllamaModel ¶ added in v1.16.1
func GetOpenAIModel ¶ added in v1.16.1
Example usage for model getters with metadata support: Pass metadataValue from your metadata file/struct, or "" if not set.
Types ¶
type Conversation ¶
type LangchainMetadata ¶
type LangchainMetadata struct {
Key string `json:"key"`
Model string `json:"model"`
CacheTTL string `json:"cacheTTL"`
Endpoint string `json:"endpoint"`
}
LangchainMetadata is a common metadata structure for langchain supported implementations.
type Message ¶ added in v1.16.0
type Message struct {
Content string `json:"content,omitempty"`
ToolCallRequest *[]llms.ToolCall `json:"toolCallRequest,omitempty"`
}
Message represents the content of a choice where it can be a text message or a tool call.
type Request ¶ added in v1.16.0
type Request struct {
// Message can be user input prompt/instructions and/or tool call responses.
Message *[]llms.MessageContent
Tools *[]llms.Tool
ToolChoice *string
Parameters map[string]*anypb.Any `json:"parameters"`
ConversationContext string `json:"conversationContext"`
Temperature float64 `json:"temperature"`
// from metadata
Key string `json:"key"`
Model string `json:"model"`
Endpoints []string `json:"endpoints"`
Policy string `json:"loadBalancingPolicy"`
}