Documentation
¶
Overview ¶
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.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateToolCallPart ¶ added in v1.17.0
func CreateToolCallPart(toolCall *llms.ToolCall) llms.ContentPart
CreateToolCallPart creates mistral and ollama api compatible tool call messages. Most LLM providers can handle tool calls using the tool call object; however, mistral and ollama requires it as text in conversation history. This is due to langchaingo limitations.
func CreateToolResponseMessage ¶ added in v1.17.0
func CreateToolResponseMessage(responses ...llms.ContentPart) llms.MessageContent
CreateToolResponseMessage creates mistral and ollama api compatible tool response message using the human role specifically otherwise mistral will reject the tool response message. Most LLM providers can handle tool call responses using the tool call response object; however, mistral and ollama requires it as text in conversation history. This is due to langchaingo limitations.
Types ¶
type LLM ¶
LLM is a helper struct that wraps a LangChain Go model
func (*LLM) Converse ¶
func (a *LLM) Converse(ctx context.Context, r *conversation.Request) (res *conversation.Response, err error)
func (*LLM) NormalizeConverseResult ¶ added in v1.17.0
func (a *LLM) NormalizeConverseResult(choices []*llms.ContentChoice) ([]conversation.Result, *conversation.Usage, error)