tools

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertMCPTools added in v0.2.4

func ConvertMCPTools(tools []mcp.Tool) []llm.Tool

ConvertToLLMTools converts mcp.Tool to llm.Tool format

func GenerateAvailableToolsContent added in v0.1.6

func GenerateAvailableToolsContent(tools []llm.Tool) (string, error)

GenerateAvailableToolsContent generates a string containing the JSON representation of the provided tools array, wrapped in [AVAILABLE_TOOLS] and [/AVAILABLE_TOOLS] tags.

✋ it works for mistral:7b

Parameters: - tools: an array of llm.Tool objects representing the tools to be converted to JSON.

Returns: - string: the JSON representation of the tools array, wrapped in [AVAILABLE_TOOLS] and [/AVAILABLE_TOOLS] tags. - error: an error if the JSON marshaling fails.

func GenerateSystemToolsInstructions added in v0.1.6

func GenerateSystemToolsInstructions() string

GenerateSystemToolsInstructions generates a string containing the system content instructions for using "function calling".

✋ Use it only if the LLM does not implement function calling.

func GenerateUserToolsInstructions added in v0.1.6

func GenerateUserToolsInstructions(userMessage string) string

GenerateUserToolsInstructions generates a string containing the user message wrapped in [INST] and [/INST] tags.

✋ it works for mistral:7b

Parameters: - userMessage: a string representing the user message to be wrapped.

Returns: - string: the user message wrapped in [INST] and [/INST] tags.

Types

This section is empty.

Jump to

Keyboard shortcuts

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