Structs§
- Braintrust
Client - Braintrust
Client Builder - Builder for creating a BraintrustClient with configuration.
- Braintrust
Stream - A stream aggregator that collects streaming chunks and produces a final value.
- Chat
Message - A chat message in the output.
- Completion
Tokens Details - Finalized
Stream - Aggregated result from a streaming response.
- Function
Call - Function details in a tool call.
- Invalid
Span Object Type - Error returned when an invalid u8 value is converted to SpanObjectType.
- Login
State - Logged-in state containing API key and org info.
- OrgInfo
- Organization info returned from login.
- Output
Choice - A choice in the output array (matches OpenAI response format).
- Prompt
Tokens Details - Span
Builder - Span
Handle - SpanLog
- Event data to log to a span. All fields are optional.
Multiple calls to
log()will merge data. - Stream
Metadata - Stream metadata with typed known fields and passthrough for extras.
- Tool
Call - A tool call in a chat message.
- Usage
- Usage statistics that can deserialize from both OpenAI and Anthropic formats.
- Usage
Metrics
Enums§
- Braintrust
Error - Parent
Span Info - Span
Object Type - The type of span object, serialized as its integer representation for wire compatibility.
- Span
Type - The type of span.
Functions§
- extract_
anthropic_ usage - extract_
openai_ usage - wrap_
stream_ with_ span - Wrap a stream with span logging.