Documentation
¶
Overview ¶
Package tools contains code for working with OpenAI tools (as in tool calling and mcp servers).
Index ¶
- func AddToolCallOutputToResponse(_ context.Context, toolCallOutput *toolsv1.ToolCallOutput, ...) error
- func ArgsToToolCallInput(ctx context.Context, name string, callID string, args string) (*toolsv1.ToolCallInput, error)
- func FixOpenAI(descriptor protoreflect.MessageDescriptor, args map[string]any)
- func ProtoToMap(m proto.Message) (map[string]any, error)
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
Types ¶
This section is empty.