metadata method
Sets metadata for the request
An object describing metadata about the request. This can be used for tracking, analytics, or other purposes. The metadata will be included in the request to Anthropic's API.
Example:
final provider = await ai()
.anthropic((anthropic) => anthropic
.metadata({
'user_id': 'user123',
'session_id': 'session456',
'application': 'my_app',
}))
.apiKey(apiKey)
.build();
Implementation
AnthropicBuilder metadata(Map<String, dynamic> data) {
_baseBuilder.extension('metadata', data);
return this;
}