Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions py/src/braintrust/functions/invoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,11 @@ def invoke(
input: The input to the function. This will be logged as the `input` field in the span.
messages: Additional OpenAI-style messages to add to the prompt (only works for llm functions).
metadata: Additional metadata to add to the span. This will be logged as the `metadata` field in the span.
It will also be available as the {{metadata}} field in the prompt and as the `metadata` argument
to the function.
It will also be available as the {{metadata}} field in the prompt. For code functions, it is passed
through the hooks (`hooks.metadata` in Python, the handler's second argument in TypeScript), not
as the handler's `metadata` argument, which is read from `input`. To fill
the handler's `metadata` argument, nest it in `input`, e.g.
`invoke(..., input={"input": ..., "metadata": {...}})`.
tags: Tags to add to the span. This will be logged as the `tags` field in the span.
parent: The parent of the function. This can be an existing span, logger, or experiment, or
the output of `.export()` if you are distributed tracing. If unspecified, will use
Expand Down
Loading