MCPcopy Create free account
hub / github.com/Effect-TS/effect / ToolCallPart

Function ToolCallPart

packages/ai/ai/src/Response.ts:1478–1499  ·  view source on GitHub ↗
(
  /**
   * Name of the tool.
   */
  name: Name,
  /**
   * Schema for the tool parameters.
   */
  params: Params
)

Source from the content-addressed store, hash-verified

1476 * @category Schemas
1477 */
1478export const ToolCallPart = <const Name extends string, Params extends Tool.AnyParametersSchema>(
1479 /**
1480 * Name of the tool.
1481 */
1482 name: Name,
1483 /**
1484 * Schema for the tool parameters.
1485 */
1486 params: Params
1487): Schema.Schema<ToolCallPart<Name, Schema.Schema.Type<Params>>, ToolCallPartEncoded> =>
1488 Schema.Struct({
1489 type: Schema.Literal("tool-call"),
1490 id: Schema.String,
1491 name: Schema.Literal(name),
1492 params,
1493 providerName: Schema.optional(Schema.String),
1494 providerExecuted: Schema.optionalWith(Schema.Boolean, { default: constFalse }),
1495 metadata: Schema.optionalWith(ProviderMetadata, { default: constEmptyObject })
1496 }).pipe(
1497 Schema.attachPropertySignature(PartTypeId, PartTypeId),
1498 Schema.annotations({ identifier: "ToolCallPart" })
1499 ) as any
1500
1501/**
1502 * Constructs a new tool call part.

Callers 3

AllPartsFunction · 0.70
PartFunction · 0.70
StreamPartFunction · 0.70

Calls 2

pipeMethod · 0.65
annotationsMethod · 0.65

Tested by

no test coverage detected