langchaingokit

package
v1.18.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 7 Imported by: 1

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

type LLM struct {
	llms.Model
	// contains filtered or unexported fields
}

LLM is a helper struct that wraps a LangChain Go model

func New added in v1.17.1

func New(logger logger.Logger) LLM

func (*LLM) Converse

func (a *LLM) Converse(ctx context.Context, r *conversation.Request) (res *conversation.Response, err error)

func (*LLM) GetModel added in v1.18.0

func (a *LLM) GetModel() string

func (*LLM) NormalizeConverseResult added in v1.17.0

func (a *LLM) NormalizeConverseResult(choices []*llms.ContentChoice) ([]conversation.Result, *conversation.Usage, error)

func (*LLM) SetModel added in v1.18.0

func (a *LLM) SetModel(model string)

SetModel sets the resolved model name that will be returned in conversation responses.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL