tools

package
v3.17.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package tools contains code for working with OpenAI tools (as in tool calling and mcp servers).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToolCallOutputToResponse

func AddToolCallOutputToResponse(_ context.Context, toolCallOutput *toolsv1.ToolCallOutput, resp *responses.ResponseNewParams) error

AddToolCallOutputToResponse takes toolCallOutput sent by chatkit and adds it to the response.

func ArgsToToolCallInput

func ArgsToToolCallInput(ctx context.Context, name string, callID string, args string) (*toolsv1.ToolCallInput, error)

ArgsToToolCallInput converts the string representation of the toolcall arguments returned by OpenAI into a proto

func FixOpenAI

func FixOpenAI(descriptor protoreflect.MessageDescriptor, args map[string]any)

FixOpenAI applies all OpenAI compatibility transformations to convert OpenAI-formatted JSON back to standard protobuf-compatible JSON. This includes: - Converting map arrays back to objects - Converting string representations back to proper JSON for google.protobuf.Value/ListValue/Struct see: https://github.com/redpanda-data/protoc-gen-go-mcp/issues/34

func ProtoToMap

func ProtoToMap(m proto.Message) (map[string]any, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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