Skip to content
1 min read · 89 words

Function: resolveToolCallParser()

ts
function resolveToolCallParser(
  option: ToolCallParserName | ToolCallParserFn | undefined,
  parsers?: Partial<
    Record<Exclude<ToolCallParserName, "auto" | "none">, ToolCallParserFn>
  >,
): ToolCallParserFn;

Defined in: src/batteries/llm/chat_common/tool_parsers.ts:1121

Resolve a toolCallParser option (a name, 'auto', 'none', or a custom fn) to a concrete ToolCallParserFn.

Parameters

ParameterTypeDefault valueDescription
option| ToolCallParserName | ToolCallParserFn | undefinedundefinedThe option value. Defaults to 'auto' when undefined.
parsersPartial<Record<Exclude<ToolCallParserName, "auto" | "none">, ToolCallParserFn>>BUNDLED_TOOL_CALL_PARSERSOverride the bundled family parsers (e.g. swap the Gemma parser).

Returns

ToolCallParserFn