toolschema

package
v8.0.54 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCodexUserAgent

func IsCodexUserAgent(headers http.Header) bool

IsCodexUserAgent reports whether headers contain a User-Agent indicating a Codex client.

func NormalizeCodexToolIntegerTypes

func NormalizeCodexToolIntegerTypes(body []byte, headers http.Header) []byte

NormalizeCodexToolIntegerTypes normalizes specified tool parameter declarations from number to integer for Codex clients across supported tool formats (OpenAI, Claude input_schema, Gemini function_declarations, and namespace tools).

func NormalizeCodexToolIntegerTypesDoc added in v8.0.52

func NormalizeCodexToolIntegerTypesDoc(doc *ojson.Doc, headers http.Header) bool

NormalizeCodexToolIntegerTypesDoc normalizes specified tool parameter declarations from number to integer for Codex clients directly on doc in place.

func NormalizeCodexToolSchemas added in v8.0.52

func NormalizeCodexToolSchemas(body []byte) []byte

NormalizeCodexToolSchemas inspects function tools in a Codex request payload and simplifies pure constant union combinations (e.g. large oneOf branch sets representing enums with descriptions, as emitted by MCP servers) into semantically equivalent enum lists, and sanitizes unsupported schema patterns. It does not normalize tool integer types because upstream OpenAI Codex models strictly validate reserved tool schemas (e.g. collaboration.wait_agent).

func NormalizeCodexToolSchemasDoc added in v8.0.52

func NormalizeCodexToolSchemasDoc(doc *ojson.Doc) bool

NormalizeCodexToolSchemasDoc inspects function tools in doc and simplifies pure constant union combinations and sanitizes unsupported schema patterns in place.

func NormalizeSingleCodexTool added in v8.0.52

func NormalizeSingleCodexTool(tool ojson.Result) ([]byte, bool)

NormalizeSingleCodexTool normalizes a single non-namespace tool declaration.

Types

This section is empty.

Jump to

Keyboard shortcuts

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