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