24 lines
1.2 KiB
TypeScript
24 lines
1.2 KiB
TypeScript
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
import type { FunctionTool } from "./FunctionTool";
|
|
import type { OpenAICustomTool } from "./OpenAICustomTool";
|
|
|
|
/**
|
|
* `Tool` is the generic form for all tools that TensorZero itself manages.
|
|
* This includes function tools (the original kind) and OpenAI's custom tools
|
|
* (which support text and grammar formats). Future additions may include MCP and other standards.
|
|
*
|
|
* We store this type (serialized) in the Array(String) in the `dynamic_tools` column
|
|
* in the ChatInference, ChatInferenceDatapoint, and BatchModelInference tables.
|
|
*
|
|
* For the wire format, we use `DynamicTool` which wraps this enum with a custom deserializer
|
|
* that allows function tools to be specified without type tags for backward compatibility,
|
|
* while other tool types require explicit tagging.
|
|
*
|
|
* Notably, provider tools (like OpenAI websearch) are not part of this enum
|
|
* as there's not really anything we can do besides experiment with them.
|
|
* They are a separate type `ProviderTool`.
|
|
*/
|
|
export type Tool =
|
|
| ({ type: "function" } & FunctionTool)
|
|
| ({ type: "openai_custom" } & OpenAICustomTool);
|