fix(rust): path-qualify attribute aliases so rust-analyzer resolves them (#45416)

rust-analyzer cannot resolve the bare alias names emitted by
macro_rules_attribute::apply, so every aliased type was invisible to it
(no go-to-definition or find-references). Referencing the aliases through
crate:: resolves them via the re-export that attribute_alias! generates.

Co-authored-by: Nate Armstrong <narmstrong@Nates-MBP.localdomain>
This commit is contained in:
nate-berri 2026-10-08 11:51:58 -07:00 • committed by GitHub
parent b0e0a305f4
commit e843cb7aca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 329 additions and 329 deletions

View file

@ -1,6 +1,6 @@
use serde_json::Value;
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct AudioTranscriptionResponseData {
pub text: String,
}

View file

@ -1,4 +1,4 @@
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Copy, Eq)]
#[serde(rename_all = "snake_case")]
pub enum BatchStatus {
@ -7,7 +7,7 @@ pub enum BatchStatus {
Completed,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Eq)]
pub struct BatchRequestCounts {
pub total: u64,
@ -15,7 +15,7 @@ pub struct BatchRequestCounts {
pub failed: u64,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Eq)]
pub struct BatchResponse {
pub id: String,

View file

@ -8,7 +8,7 @@ pub use content::{
};
/// Reasoning effort level accepted or applied by the model.
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Copy, Eq, IntoStaticStr)]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
@ -44,14 +44,14 @@ impl ReasoningEffort {
}
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(untagged)]
pub enum ChatMessageContent {
Text(String),
Parts(Vec<Value>),
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ChatMessage {
pub role: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
@ -62,7 +62,7 @@ pub struct ChatMessage {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ChatCompletionToolCallFunctionChunk {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
@ -71,7 +71,7 @@ pub struct ChatCompletionToolCallFunctionChunk {
pub provider_specific_fields: Option<Map<String, Value>>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ChatCompletionToolCallChunk {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
@ -81,7 +81,7 @@ pub struct ChatCompletionToolCallChunk {
pub index: i64,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ChatCompletionThinkingBlock {
Thinking {
@ -102,7 +102,7 @@ pub enum ChatCompletionThinkingBlock {
/// OpenAI `usage`, including the `prompt_tokens_details` split LiteLLM's Python
/// path reports so cost tracking sees the same numbers on either path.
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct PromptTokensDetails {
pub cached_tokens: u64,
@ -110,7 +110,7 @@ pub struct PromptTokensDetails {
pub text_tokens: u64,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ChatCompletionsUsage {
pub prompt_tokens: u64,
@ -119,7 +119,7 @@ pub struct ChatCompletionsUsage {
pub prompt_tokens_details: PromptTokensDetails,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ChatCompletionsChoiceMessage {
pub role: String,
// Whether an empty turn is `None` or `""` is the provider's choice, not a
@ -129,7 +129,7 @@ pub struct ChatCompletionsChoiceMessage {
pub content: Option<String>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ChatCompletionsChoice {
pub index: u64,
pub message: ChatCompletionsChoiceMessage,
@ -141,7 +141,7 @@ pub struct ChatCompletionsChoice {
/// There is deliberately no `id`: Python mints the `chatcmpl-…` id on the
/// `ModelResponse` it already created, and echoing the provider's own id here
/// would change it. Pinned by `response_carries_no_id` in the Anthropic chat transformation tests.
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ChatCompletionsResponse {
pub created: u64,
pub model: String,
@ -149,7 +149,7 @@ pub struct ChatCompletionsResponse {
pub usage: ChatCompletionsUsage,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ChatCompletionDelta {
#[serde(default, skip_serializing_if = "Option::is_none")]
@ -168,7 +168,7 @@ pub struct ChatCompletionDelta {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ChatCompletionStreamingChoice {
pub index: u64,
pub delta: ChatCompletionDelta,
@ -178,7 +178,7 @@ pub struct ChatCompletionStreamingChoice {
pub logprobs: Option<Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ChatCompletionChunk {
pub id: String,
pub created: u64,

View file

@ -2,7 +2,7 @@ use serde_json::{Map, Value};
use crate::formats::messages::{CacheControl, CitationsConfig, ContentSource};
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ChatContentPart {
Text {
@ -58,21 +58,21 @@ pub enum ChatContentPart {
},
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct PromptCacheBreakpoint {
pub mode: PromptCacheMode,
#[serde(flatten)]
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Copy, Eq)]
#[serde(rename_all = "snake_case")]
pub enum PromptCacheMode {
Explicit,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(untagged)]
pub enum ChatMediaUrl {
Url(String),
@ -80,7 +80,7 @@ pub enum ChatMediaUrl {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ChatMediaUrlParameters {
pub url: String,
pub detail: Option<String>,
@ -90,7 +90,7 @@ pub struct ChatMediaUrlParameters {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ChatInputAudio {
pub data: String,
pub format: String,
@ -99,7 +99,7 @@ pub struct ChatInputAudio {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ChatFile {
pub file_data: Option<String>,
@ -113,7 +113,7 @@ pub struct ChatFile {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ChatVideoMetadata {
pub fps: Option<serde_json::Number>,
@ -124,7 +124,7 @@ pub struct ChatVideoMetadata {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ChatLogprobs {
pub content: Option<Vec<ChatTokenLogprob>>,
@ -134,7 +134,7 @@ pub struct ChatLogprobs {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ChatTokenLogprob {
pub token: String,
pub logprob: serde_json::Number,
@ -145,7 +145,7 @@ pub struct ChatTokenLogprob {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ChatTopLogprob {
pub token: String,
pub logprob: serde_json::Number,

View file

@ -3,7 +3,7 @@ use serde_json::{Map, Value};
use super::{CacheControl, MessagesToolParam};
use crate::json_schema::JsonSchema;
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ContentSource {
Base64 {
@ -35,14 +35,14 @@ pub enum ContentSource {
},
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(untagged)]
pub enum BlockContent {
Text(String),
Blocks(Vec<MessagesContentPart>),
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ToolCaller {
Direct {
@ -64,7 +64,7 @@ pub enum ToolCaller {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct CitationsConfig {
pub enabled: Option<bool>,
@ -73,7 +73,7 @@ pub struct CitationsConfig {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct PageCitation {
pub cited_text: String,
pub document_index: u64,
@ -86,7 +86,7 @@ pub struct PageCitation {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct CharCitation {
pub cited_text: String,
pub document_index: u64,
@ -99,7 +99,7 @@ pub struct CharCitation {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ContentBlockCitation {
pub cited_text: String,
pub document_index: u64,
@ -112,7 +112,7 @@ pub struct ContentBlockCitation {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct WebSearchCitation {
pub cited_text: String,
pub url: String,
@ -123,7 +123,7 @@ pub struct WebSearchCitation {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct SearchResultCitation {
pub cited_text: String,
pub search_result_index: u64,
@ -135,7 +135,7 @@ pub struct SearchResultCitation {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum Citation {
PageLocation(PageCitation),
@ -145,7 +145,7 @@ pub enum Citation {
SearchResultLocation(SearchResultCitation),
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum MessagesContentPart {
Text(TextBlock),
@ -179,7 +179,7 @@ pub enum MessagesContentPart {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct TextBlock {
pub text: String,
pub citations: Option<Vec<Citation>>,
@ -189,7 +189,7 @@ pub struct TextBlock {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ImageBlock {
pub source: ContentSource,
pub cache_control: Option<CacheControl>,
@ -198,7 +198,7 @@ pub struct ImageBlock {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct DocumentBlock {
pub source: ContentSource,
pub title: Option<String>,
@ -210,7 +210,7 @@ pub struct DocumentBlock {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct SearchResultBlock {
pub source: String,
pub title: String,
@ -221,7 +221,7 @@ pub struct SearchResultBlock {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ThinkingBlock {
pub thinking: String,
pub signature: String,
@ -229,7 +229,7 @@ pub struct ThinkingBlock {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct RedactedThinkingBlock {
pub data: String,
#[serde(flatten)]
@ -237,7 +237,7 @@ pub struct RedactedThinkingBlock {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ToolUseBlock {
pub id: String,
pub name: String,
@ -250,7 +250,7 @@ pub struct ToolUseBlock {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ToolResultBlock {
pub tool_use_id: String,
pub content: Option<BlockContent>,
@ -262,7 +262,7 @@ pub struct ToolResultBlock {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ToolReferenceBlock {
pub tool_name: String,
pub cache_control: Option<CacheControl>,
@ -271,7 +271,7 @@ pub struct ToolReferenceBlock {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct BrowserStateBlock {
pub tabs: Vec<BrowserTab>,
pub state_changes: Option<Vec<BrowserStateChange>>,
@ -281,7 +281,7 @@ pub struct BrowserStateBlock {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct BrowserTab {
pub tab_id: String,
pub title: String,
@ -291,7 +291,7 @@ pub struct BrowserTab {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum BrowserStateChange {
TabOpened {
@ -326,7 +326,7 @@ pub enum BrowserStateChange {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ServerToolUseBlock {
pub id: String,
pub name: String,
@ -338,7 +338,7 @@ pub struct ServerToolUseBlock {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ServerToolResultBlock<C> {
pub tool_use_id: String,
pub content: C,
@ -349,7 +349,7 @@ pub struct ServerToolResultBlock<C> {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ServerToolError {
pub error_code: String,
pub error_message: Option<String>,
@ -357,14 +357,14 @@ pub struct ServerToolError {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(untagged)]
pub enum WebSearchToolResultContent {
Error(WebSearchResultError),
Results(Vec<WebSearchResult>),
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct WebSearchResultError {
#[serde(rename = "type")]
pub error_type: WebSearchResultErrorType,
@ -373,14 +373,14 @@ pub struct WebSearchResultError {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(rename_all = "snake_case")]
pub enum WebSearchResultErrorType {
WebSearchToolResultError,
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct WebSearchResult {
#[serde(rename = "type")]
pub result_type: WebSearchResultType,
@ -392,13 +392,13 @@ pub struct WebSearchResult {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(rename_all = "snake_case")]
pub enum WebSearchResultType {
WebSearchResult,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum WebFetchToolResultContent {
WebFetchToolResultError(ServerToolError),
@ -406,7 +406,7 @@ pub enum WebFetchToolResultContent {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct WebFetchResult {
pub url: String,
pub content: WebFetchDocument,
@ -415,13 +415,13 @@ pub struct WebFetchResult {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum WebFetchDocument {
Document(Box<DocumentBlock>),
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum CodeExecutionToolResultContent {
CodeExecutionToolResultError(ServerToolError),
@ -429,14 +429,14 @@ pub enum CodeExecutionToolResultContent {
EncryptedCodeExecutionResult(EncryptedCodeExecutionResult),
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum BashCodeExecutionToolResultContent {
BashCodeExecutionToolResultError(ServerToolError),
BashCodeExecutionResult(CodeExecutionResult<BashCodeExecutionOutput>),
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct CodeExecutionResult<O = CodeExecutionOutput> {
pub stdout: String,
pub stderr: String,
@ -446,7 +446,7 @@ pub struct CodeExecutionResult<O = CodeExecutionOutput> {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct EncryptedCodeExecutionResult {
pub encrypted_stdout: String,
pub stderr: String,
@ -456,7 +456,7 @@ pub struct EncryptedCodeExecutionResult {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum CodeExecutionOutput {
CodeExecutionOutput {
@ -466,7 +466,7 @@ pub enum CodeExecutionOutput {
},
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum BashCodeExecutionOutput {
BashCodeExecutionOutput {
@ -476,7 +476,7 @@ pub enum BashCodeExecutionOutput {
},
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum TextEditorCodeExecutionToolResultContent {
TextEditorCodeExecutionToolResultError(ServerToolError),
@ -486,7 +486,7 @@ pub enum TextEditorCodeExecutionToolResultContent {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct TextEditorViewResult {
pub content: String,
pub file_type: TextEditorFileType,
@ -497,7 +497,7 @@ pub struct TextEditorViewResult {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(rename_all = "snake_case")]
pub enum TextEditorFileType {
Text,
@ -505,7 +505,7 @@ pub enum TextEditorFileType {
Pdf,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct TextEditorCreateResult {
pub is_file_update: bool,
#[serde(flatten)]
@ -513,7 +513,7 @@ pub struct TextEditorCreateResult {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct TextEditorStrReplaceResult {
pub lines: Option<Vec<String>>,
@ -525,27 +525,27 @@ pub struct TextEditorStrReplaceResult {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ToolSearchToolResultContent {
ToolSearchToolResultError(ServerToolError),
ToolSearchToolSearchResult(ToolSearchResult),
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ToolSearchResult {
pub tool_references: Vec<ToolSearchReference>,
#[serde(flatten)]
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ToolSearchReference {
ToolReference(ToolReferenceBlock),
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum AdvisorToolResultContent {
AdvisorToolResultError(ServerToolError),
@ -566,7 +566,7 @@ pub enum AdvisorToolResultContent {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ContainerUploadBlock {
pub file_id: String,
pub cache_control: Option<CacheControl>,
@ -575,7 +575,7 @@ pub struct ContainerUploadBlock {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct McpToolUseBlock {
pub id: String,
pub name: String,
@ -587,7 +587,7 @@ pub struct McpToolUseBlock {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct McpToolResultBlock {
pub tool_use_id: String,
pub content: Option<McpToolResultContent>,
@ -597,20 +597,20 @@ pub struct McpToolResultBlock {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(untagged)]
pub enum McpToolResultContent {
Text(String),
Blocks(Vec<McpToolResultText>),
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum McpToolResultText {
Text(TextBlock),
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct McpToolListingBlock {
pub mcp_server_name: String,
pub tools: Vec<McpListedTool>,
@ -619,7 +619,7 @@ pub struct McpToolListingBlock {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct McpListedTool {
pub name: String,
pub description: Option<String>,
@ -629,7 +629,7 @@ pub struct McpListedTool {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct CompactionBlock {
pub content: Option<String>,
@ -641,7 +641,7 @@ pub struct CompactionBlock {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ToolChange {
ToolAddition(ToolChangeBlock),
@ -649,7 +649,7 @@ pub enum ToolChange {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ToolChangeBlock {
pub tool: ToolChangeTarget,
pub cache_control: Option<CacheControl>,
@ -657,7 +657,7 @@ pub struct ToolChangeBlock {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ToolChangeTarget {
ToolReference {
@ -684,7 +684,7 @@ pub enum ToolChangeTarget {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct FallbackBlock {
pub from: FallbackModel,
pub to: FallbackModel,
@ -693,14 +693,14 @@ pub struct FallbackBlock {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct FallbackModel {
pub model: String,
#[serde(flatten)]
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum FallbackTrigger {
Refusal {

View file

@ -4,7 +4,7 @@ use crate::json_schema::JsonSchema;
use crate::recognized::Recognized;
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct MessagesMetadata {
pub user_id: Option<String>,
@ -13,7 +13,7 @@ pub struct MessagesMetadata {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct OutputFormat {
#[serde(rename = "type")]
pub format_type: OutputFormatType,
@ -23,14 +23,14 @@ pub struct OutputFormat {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(rename_all = "snake_case")]
pub enum OutputFormatType {
JsonSchema,
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct MessagesCompaction {
#[serde(rename = "type")]
pub compaction_type: CompactionType,
@ -39,14 +39,14 @@ pub struct MessagesCompaction {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(rename_all = "snake_case")]
pub enum CompactionType {
Summarize,
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct MessagesContainer {
pub id: Option<String>,
@ -57,7 +57,7 @@ pub struct MessagesContainer {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ContainerSkill {
#[serde(rename = "type")]
pub skill_type: SkillType,
@ -67,7 +67,7 @@ pub struct ContainerSkill {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(rename_all = "snake_case")]
pub enum SkillType {
Anthropic,
@ -75,7 +75,7 @@ pub enum SkillType {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct McpServer {
#[serde(rename = "type")]
pub server_type: McpServerType,
@ -87,14 +87,14 @@ pub struct McpServer {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(rename_all = "snake_case")]
pub enum McpServerType {
Url,
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct McpToolConfiguration {
pub allowed_tools: Option<Vec<String>>,
@ -104,7 +104,7 @@ pub struct McpToolConfiguration {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct StopDetails {
#[serde(rename = "type")]
pub detail_type: Recognized<StopDetailsType>,
@ -114,14 +114,14 @@ pub struct StopDetails {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(rename_all = "snake_case")]
pub enum StopDetailsType {
Refusal,
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ContextManagementResponse {
pub applied_edits: Option<Vec<AppliedEdit>>,
@ -130,7 +130,7 @@ pub struct ContextManagementResponse {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct AppliedEdit {
#[serde(rename = "type")]
@ -143,7 +143,7 @@ pub struct AppliedEdit {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct Safeguard {
#[serde(rename = "type")]
pub safeguard_type: String,
@ -275,7 +275,7 @@ impl From<StopReason> for String {
}
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(untagged)]
pub enum ContainerReference {
Id(String),
@ -283,7 +283,7 @@ pub enum ContainerReference {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct MessagesDiagnosticsParam {
#[serde(
@ -298,7 +298,7 @@ pub struct MessagesDiagnosticsParam {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct MessagesDiagnostics {
pub cache_miss_reason: Option<Recognized<CacheMissReason>>,
@ -306,7 +306,7 @@ pub struct MessagesDiagnostics {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum CacheMissReason {
ModelChanged(CacheMissedTokens),
@ -323,7 +323,7 @@ pub enum CacheMissReason {
},
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct CacheMissedTokens {
pub cache_missed_input_tokens: u64,
#[serde(flatten)]

View file

@ -4,14 +4,14 @@ use strum::IntoStaticStr;
use crate::formats::chat_completions::ReasoningEffort;
use crate::recognized::Recognized;
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(untagged)]
pub enum SystemPrompt {
Text(String),
Blocks(Vec<ContentBlock>),
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(untagged)]
pub enum MessageContent {
Text(String),
@ -57,7 +57,7 @@ impl From<ContentBlockType> for String {
}
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ContentBlock {
#[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
@ -102,7 +102,7 @@ impl ContentBlock {
}
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct CacheControl {
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
@ -115,7 +115,7 @@ pub struct CacheControl {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct Message {
pub role: String,
pub content: MessageContent,
@ -123,7 +123,7 @@ pub struct Message {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Copy, Hash, IntoStaticStr, Eq)]
#[serde(rename_all = "lowercase")]
#[strum(serialize_all = "lowercase")]
@ -153,7 +153,7 @@ impl From<EffortLevel> for ReasoningEffort {
}
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Copy, IntoStaticStr, Eq)]
#[serde(rename_all = "lowercase")]
#[strum(serialize_all = "lowercase")]
@ -170,7 +170,7 @@ impl Speed {
/// The tools whose presence changes how the request is sent. Every other tool, custom or
/// server, deserializes as `Recognized::Unrecognized` and passes through verbatim.
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type")]
pub enum MessagesTool {
#[serde(rename = "advisor_20260301")]
@ -190,7 +190,7 @@ pub enum MessagesTool {
},
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ContextTrigger {
InputTokens {
@ -205,7 +205,7 @@ pub enum ContextTrigger {
},
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type")]
pub enum ContextEdit {
#[serde(rename = "compact_20260112")]
@ -225,7 +225,7 @@ pub enum ContextEdit {
},
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ContextManagement {
#[serde(default, skip_serializing_if = "Option::is_none")]
@ -234,7 +234,7 @@ pub struct ContextManagement {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct OutputConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
@ -251,7 +251,7 @@ impl OutputConfig {
}
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Copy, Eq)]
#[serde(rename_all = "lowercase")]
pub enum ThinkingDisplay {
@ -260,7 +260,7 @@ pub enum ThinkingDisplay {
Updates,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct EnabledThinking {
#[serde(default, skip_serializing_if = "Option::is_none")]
@ -271,7 +271,7 @@ pub struct EnabledThinking {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct AdaptiveThinking {
#[serde(default, skip_serializing_if = "Option::is_none")]
@ -280,14 +280,14 @@ pub struct AdaptiveThinking {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct DisabledThinking {
#[serde(flatten)]
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "lowercase")]
pub enum ThinkingConfig {
Enabled(EnabledThinking),
@ -311,7 +311,7 @@ impl ThinkingConfig {
}
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct MessagesRequest {
pub model: String,
pub messages: Vec<Message>,
@ -319,7 +319,7 @@ pub struct MessagesRequest {
pub params: MessagesOptionalParams,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct MessagesOptionalParams {
#[serde(skip_serializing_if = "Option::is_none")]

View file

@ -1,6 +1,6 @@
use serde_json::{Map, Value};
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct MessagesResponse {
pub id: String,
#[serde(rename = "type")]

View file

@ -1,6 +1,6 @@
use serde_json::{Map, Value};
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct MessagesStreamUsage {
#[serde(default, skip_serializing_if = "Option::is_none")]
@ -17,7 +17,7 @@ pub struct MessagesStreamUsage {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct MessagesStreamMessage {
pub id: String,
#[serde(rename = "type")]
@ -32,7 +32,7 @@ pub struct MessagesStreamMessage {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum MessagesContentBlockDelta {
TextDelta {
@ -56,7 +56,7 @@ pub enum MessagesContentBlockDelta {
},
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct MessagesContentBlock {
#[serde(rename = "type")]
pub block_type: String,
@ -82,7 +82,7 @@ pub struct MessagesContentBlock {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct MessagesDelta {
#[serde(default, skip_serializing_if = "Option::is_none")]
@ -97,7 +97,7 @@ pub struct MessagesDelta {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct MessagesStreamError {
#[serde(rename = "type")]
pub error_type: String,
@ -108,7 +108,7 @@ pub struct MessagesStreamError {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum MessagesStreamEvent {
MessageStart {

View file

@ -4,7 +4,7 @@ use serde_json::{Map, Value};
use super::{CacheControl, CitationsConfig, McpListedTool};
use crate::json_schema::JsonSchema;
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Copy, Eq)]
pub enum AllowedCaller {
#[serde(rename = "direct")]
@ -18,7 +18,7 @@ pub enum AllowedCaller {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct WebSearchUserLocation {
#[serde(rename = "type")]
pub location_type: UserLocationType,
@ -30,14 +30,14 @@ pub struct WebSearchUserLocation {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(rename_all = "snake_case")]
pub enum UserLocationType {
Approximate,
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ToolChoice {
#[serde(rename = "type")]
pub choice_type: ToolChoiceType,
@ -47,7 +47,7 @@ pub struct ToolChoice {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(rename_all = "snake_case")]
pub enum ToolChoiceType {
Auto,
@ -57,7 +57,7 @@ pub enum ToolChoiceType {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct CustomTool {
#[serde(rename = "type")]
pub tool_type: Option<CustomToolType>,
@ -74,83 +74,83 @@ pub struct CustomTool {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(rename_all = "snake_case")]
pub enum CustomToolType {
Custom,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Copy, Eq)]
#[serde(rename_all = "snake_case")]
pub enum BashToolName {
Bash,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Copy, Eq)]
#[serde(rename_all = "snake_case")]
pub enum StrReplaceEditorName {
StrReplaceEditor,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Copy, Eq)]
#[serde(rename_all = "snake_case")]
pub enum StrReplaceBasedEditToolName {
StrReplaceBasedEditTool,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Copy, Eq)]
#[serde(rename_all = "snake_case")]
pub enum MemoryToolName {
Memory,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Copy, Eq)]
#[serde(rename_all = "snake_case")]
pub enum ComputerToolName {
Computer,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Copy, Eq)]
#[serde(rename_all = "snake_case")]
pub enum CodeExecutionToolName {
CodeExecution,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Copy, Eq)]
#[serde(rename_all = "snake_case")]
pub enum ToolSearchRegexToolName {
ToolSearchToolRegex,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Copy, Eq)]
#[serde(rename_all = "snake_case")]
pub enum ToolSearchBm25ToolName {
ToolSearchToolBm25,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Copy, Eq)]
#[serde(rename_all = "snake_case")]
pub enum WebSearchToolName {
WebSearch,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Copy, Eq)]
#[serde(rename_all = "snake_case")]
pub enum WebFetchToolName {
WebFetch,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Copy, Eq)]
#[serde(rename_all = "snake_case")]
pub enum AdvisorToolName {
@ -158,7 +158,7 @@ pub enum AdvisorToolName {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ServerTool<N> {
pub name: N,
pub allowed_callers: Option<Vec<AllowedCaller>>,
@ -170,7 +170,7 @@ pub struct ServerTool<N> {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ClientTool<N> {
pub name: N,
pub allowed_callers: Option<Vec<AllowedCaller>>,
@ -183,7 +183,7 @@ pub struct ClientTool<N> {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct TextEditorTool20250728 {
pub name: StrReplaceBasedEditToolName,
pub allowed_callers: Option<Vec<AllowedCaller>>,
@ -197,7 +197,7 @@ pub struct TextEditorTool20250728 {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ComputerTool {
pub name: ComputerToolName,
pub display_width_px: u64,
@ -213,7 +213,7 @@ pub struct ComputerTool {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ComputerTool20251124 {
pub name: ComputerToolName,
pub display_width_px: u64,
@ -229,7 +229,7 @@ pub struct ComputerTool20251124 {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Copy, Eq)]
#[serde(rename_all = "snake_case")]
pub enum ResponseInclusion {
@ -238,7 +238,7 @@ pub enum ResponseInclusion {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct WebSearchTool {
pub name: WebSearchToolName,
pub allowed_callers: Option<Vec<AllowedCaller>>,
@ -254,7 +254,7 @@ pub struct WebSearchTool {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct WebSearchTool20260318 {
pub name: WebSearchToolName,
pub allowed_callers: Option<Vec<AllowedCaller>>,
@ -270,7 +270,7 @@ pub struct WebSearchTool20260318 {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum UrlSourceToolReference {
ToolReference {
@ -280,7 +280,7 @@ pub enum UrlSourceToolReference {
},
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ToolResultUrlSource {
All {
@ -303,7 +303,7 @@ pub enum ToolResultUrlSource {
},
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum UserInputUrlSource {
All {
@ -317,7 +317,7 @@ pub enum UserInputUrlSource {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct WebFetchUrlSources {
pub client_tool_results: Option<ToolResultUrlSource>,
pub server_tool_results: Option<ToolResultUrlSource>,
@ -327,7 +327,7 @@ pub struct WebFetchUrlSources {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct WebFetchTool {
pub name: WebFetchToolName,
pub allowed_callers: Option<Vec<AllowedCaller>>,
@ -345,7 +345,7 @@ pub struct WebFetchTool {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct WebFetchTool20260309 {
pub name: WebFetchToolName,
pub allowed_callers: Option<Vec<AllowedCaller>>,
@ -364,7 +364,7 @@ pub struct WebFetchTool20260309 {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct WebFetchTool20260318 {
pub name: WebFetchToolName,
pub allowed_callers: Option<Vec<AllowedCaller>>,
@ -384,7 +384,7 @@ pub struct WebFetchTool20260318 {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct AdvisorTool {
pub name: AdvisorToolName,
pub model: String,
@ -400,7 +400,7 @@ pub struct AdvisorTool {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ToolsetToolConfig {
pub defer_loading: Option<bool>,
pub enabled: Option<bool>,
@ -409,7 +409,7 @@ pub struct ToolsetToolConfig {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct McpToolset {
pub mcp_server_name: String,
pub cache_control: Option<CacheControl>,
@ -421,7 +421,7 @@ pub struct McpToolset {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct BrowserToolsetConfigs {
#[serde(rename = "type")]
pub type_text: Option<ToolsetToolConfig>,
@ -460,7 +460,7 @@ pub struct BrowserToolsetConfigs {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ComputerToolsetConfigs {
#[serde(rename = "type")]
pub type_text: Option<ToolsetToolConfig>,
@ -485,7 +485,7 @@ pub struct ComputerToolsetConfigs {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct Toolset<C> {
pub cache_control: Option<CacheControl>,
pub configs: Option<Box<C>>,
@ -493,7 +493,7 @@ pub struct Toolset<C> {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type")]
pub enum BuiltinMessagesTool {
#[serde(rename = "bash_20241022")]
@ -556,7 +556,7 @@ pub enum BuiltinMessagesTool {
McpToolset(McpToolset),
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(untagged)]
pub enum MessagesToolParam {
Builtin(Box<BuiltinMessagesTool>),

View file

@ -3,7 +3,7 @@ use serde_json::{Map, Value};
use crate::recognized::Recognized;
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ServerToolUsage {
pub web_search_requests: Option<u64>,
@ -13,7 +13,7 @@ pub struct ServerToolUsage {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct UsageIteration {
#[serde(rename = "type")]
pub iteration_type: Recognized<UsageIterationType>,
@ -27,7 +27,7 @@ pub struct UsageIteration {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(rename_all = "snake_case")]
pub enum UsageIterationType {
Compaction,
@ -37,7 +37,7 @@ pub enum UsageIterationType {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct MessagesUsage {
pub input_tokens: Option<u64>,
@ -56,7 +56,7 @@ pub struct MessagesUsage {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct CacheCreationUsage {
pub ephemeral_1h_input_tokens: Option<u64>,
@ -66,7 +66,7 @@ pub struct CacheCreationUsage {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct MessagesOutputTokensDetails {
pub thinking_tokens: Option<u64>,

View file

@ -5,7 +5,7 @@ use serde_with::serde_as;
use crate::serde_compat::{FiniteF64, LaxI64};
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type")]
pub enum OcrDocument {
#[serde(rename = "document_url")]
@ -49,7 +49,7 @@ impl OcrDocument {
}
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Copy, Default, Eq)]
#[serde(rename_all = "lowercase")]
pub enum OcrResponseFormat {
@ -59,7 +59,7 @@ pub enum OcrResponseFormat {
}
#[serde_as]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct OcrPageDimensions {
#[serde_as(deserialize_as = "Option<LaxI64>")]
@ -70,7 +70,7 @@ pub struct OcrPageDimensions {
pub width: Option<i64>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct OcrPageImage {
pub image_base64: Option<String>,
@ -80,7 +80,7 @@ pub struct OcrPageImage {
}
#[serde_as]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct OcrPage {
#[serde_as(deserialize_as = "LaxI64")]
@ -93,7 +93,7 @@ pub struct OcrPage {
}
#[serde_as]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct OcrUsageInfo {
#[serde_as(deserialize_as = "Option<LaxI64>")]
@ -108,7 +108,7 @@ pub struct OcrUsageInfo {
pub extra_fields: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct LiteLLMOcrResponse {
pub pages: Vec<OcrPage>,
pub model: String,
@ -152,7 +152,7 @@ fn ocr_object() -> String {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct OcrBoundingBox {
pub top_left_x: Option<serde_json::Number>,

View file

@ -2,7 +2,7 @@ use crate::formats::chat_completions::PromptCacheBreakpoint;
use serde_json::{Map, Value};
use std::collections::BTreeMap;
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ResponsesOutputItem {
Message(ResponsesMessage),
@ -35,7 +35,7 @@ pub enum ResponsesOutputItem {
CustomToolCallOutput(ResponsesCustomToolCallOutput),
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ResponsesContentPart {
OutputText {
@ -64,7 +64,7 @@ pub enum ResponsesContentPart {
},
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ResponsesAnnotation {
UrlCitation(ResponsesUrlCitation),
@ -73,7 +73,7 @@ pub enum ResponsesAnnotation {
ContainerFileCitation(ResponsesFileCitation),
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ResponsesCodeOutput {
Logs {
@ -89,7 +89,7 @@ pub enum ResponsesCodeOutput {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesMessage {
pub id: Option<String>,
@ -102,7 +102,7 @@ pub struct ResponsesMessage {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesFunctionCall {
pub id: Option<String>,
@ -118,7 +118,7 @@ pub struct ResponsesFunctionCall {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesCustomToolCall {
pub id: Option<String>,
@ -134,7 +134,7 @@ pub struct ResponsesCustomToolCall {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesReasoning {
pub id: Option<String>,
@ -147,7 +147,7 @@ pub struct ResponsesReasoning {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesWebSearchCall {
pub id: Option<String>,
@ -158,7 +158,7 @@ pub struct ResponsesWebSearchCall {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesFileSearchCall {
pub id: Option<String>,
@ -170,7 +170,7 @@ pub struct ResponsesFileSearchCall {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesFileSearchResult {
pub file_id: Option<String>,
@ -183,7 +183,7 @@ pub struct ResponsesFileSearchResult {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesImageGenerationCall {
pub id: Option<String>,
@ -200,7 +200,7 @@ pub struct ResponsesImageGenerationCall {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesCodeInterpreterCall {
pub id: Option<String>,
@ -213,7 +213,7 @@ pub struct ResponsesCodeInterpreterCall {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesMcpCall {
pub id: Option<String>,
@ -229,7 +229,7 @@ pub struct ResponsesMcpCall {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesUrlCitation {
pub url: Option<String>,
@ -241,7 +241,7 @@ pub struct ResponsesUrlCitation {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesFileCitation {
pub file_id: Option<String>,
@ -254,7 +254,7 @@ pub struct ResponsesFileCitation {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ResponsesWebSearchAction {
Search {
@ -283,7 +283,7 @@ pub enum ResponsesWebSearchAction {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesWebSearchSource {
#[serde(rename = "type")]
@ -294,7 +294,7 @@ pub struct ResponsesWebSearchSource {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesMcpListTools {
pub id: Option<String>,
@ -306,7 +306,7 @@ pub struct ResponsesMcpListTools {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesMcpTool {
pub name: Option<String>,
@ -317,14 +317,14 @@ pub struct ResponsesMcpTool {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(untagged)]
pub enum ResponsesMcpError {
Message(String),
Detail(ResponsesMcpErrorDetail),
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ResponsesMcpErrorDetail {
McpProtocolError {
@ -346,7 +346,7 @@ pub enum ResponsesMcpErrorDetail {
},
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ResponsesToolCaller {
Direct {
@ -360,14 +360,14 @@ pub enum ResponsesToolCaller {
},
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(untagged)]
pub enum ResponsesToolOutput {
Text(String),
Content(Vec<ResponsesInputContent>),
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ResponsesInputContent {
InputText {
@ -407,7 +407,7 @@ pub enum ResponsesInputContent {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesFunctionCallOutput {
pub id: Option<String>,
@ -423,7 +423,7 @@ pub struct ResponsesFunctionCallOutput {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesCustomToolCallOutput {
pub id: Option<String>,
@ -437,7 +437,7 @@ pub struct ResponsesCustomToolCallOutput {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesSafetyCheck {
pub id: Option<String>,
@ -448,7 +448,7 @@ pub struct ResponsesSafetyCheck {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesComputerCall {
pub id: Option<String>,
@ -461,7 +461,7 @@ pub struct ResponsesComputerCall {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ResponsesComputerAction {
Click {
@ -526,7 +526,7 @@ pub enum ResponsesComputerAction {
},
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ResponsesCoordinate {
pub x: i64,
pub y: i64,
@ -535,7 +535,7 @@ pub struct ResponsesCoordinate {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesComputerCallOutput {
pub id: Option<String>,
@ -548,7 +548,7 @@ pub struct ResponsesComputerCallOutput {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ResponsesComputerOutput {
ComputerScreenshot {
@ -562,7 +562,7 @@ pub enum ResponsesComputerOutput {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesProgram {
pub id: Option<String>,
@ -574,7 +574,7 @@ pub struct ResponsesProgram {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesProgramOutput {
pub id: Option<String>,
@ -586,7 +586,7 @@ pub struct ResponsesProgramOutput {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesToolSearchCall {
pub id: Option<String>,
@ -600,7 +600,7 @@ pub struct ResponsesToolSearchCall {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesToolSearchOutput {
pub id: Option<String>,
@ -614,7 +614,7 @@ pub struct ResponsesToolSearchOutput {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesAdditionalTools {
pub id: Option<String>,
@ -625,7 +625,7 @@ pub struct ResponsesAdditionalTools {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesCompaction {
pub id: Option<String>,
@ -636,7 +636,7 @@ pub struct ResponsesCompaction {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesLocalShellCall {
pub id: Option<String>,
@ -647,7 +647,7 @@ pub struct ResponsesLocalShellCall {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ResponsesLocalShellAction {
Exec {
@ -665,7 +665,7 @@ pub enum ResponsesLocalShellAction {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesLocalShellCallOutput {
pub id: Option<String>,
@ -676,7 +676,7 @@ pub struct ResponsesLocalShellCallOutput {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesShellCall {
pub id: Option<String>,
@ -691,7 +691,7 @@ pub struct ResponsesShellCall {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesShellAction {
pub commands: Option<Vec<String>>,
@ -701,7 +701,7 @@ pub struct ResponsesShellAction {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ResponsesShellEnvironment {
Local {
@ -716,7 +716,7 @@ pub enum ResponsesShellEnvironment {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesShellCallOutput {
pub id: Option<String>,
@ -731,7 +731,7 @@ pub struct ResponsesShellCallOutput {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesShellOutputChunk {
pub outcome: Option<ResponsesShellOutcome>,
@ -742,7 +742,7 @@ pub struct ResponsesShellOutputChunk {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ResponsesShellOutcome {
Timeout {
@ -757,7 +757,7 @@ pub enum ResponsesShellOutcome {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesApplyPatchCall {
pub id: Option<String>,
@ -770,7 +770,7 @@ pub struct ResponsesApplyPatchCall {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ResponsesApplyPatchOperation {
CreateFile {
@ -793,7 +793,7 @@ pub enum ResponsesApplyPatchOperation {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesApplyPatchCallOutput {
pub id: Option<String>,
@ -807,7 +807,7 @@ pub struct ResponsesApplyPatchCallOutput {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesMcpApprovalRequest {
pub id: Option<String>,
@ -819,7 +819,7 @@ pub struct ResponsesMcpApprovalRequest {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesMcpApprovalResponse {
pub id: Option<String>,

View file

@ -1,6 +1,6 @@
use serde_json::{Map, Value};
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ResponsesApiResponse {
pub id: String,
pub model: String,

View file

@ -38,7 +38,7 @@ impl ResponsesWsEventType {
}
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct ResponsesWsEvent {
#[serde(rename = "type")]
pub event_type: ResponsesWsEventType,
@ -64,7 +64,7 @@ impl ResponsesWsEvent {
}
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Eq)]
pub struct ResponsesErrorFrame {
#[serde(rename = "type")]
@ -84,7 +84,7 @@ impl ResponsesErrorFrame {
}
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Eq)]
pub struct ResponsesErrorBody {
#[serde(rename = "type")]
@ -93,7 +93,7 @@ pub struct ResponsesErrorBody {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ResponsesEventResponse {
pub id: Option<String>,

View file

@ -1,6 +1,6 @@
use serde_json::{Map, Value};
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct ProviderSpecificHeader {
#[serde(default)]
@ -9,7 +9,7 @@ pub struct ProviderSpecificHeader {
pub extra_headers: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(untagged)]
pub enum ProviderSpecificHeaders {
One(ProviderSpecificHeader),

View file

@ -1,21 +1,21 @@
use indexmap::IndexMap;
use serde_json::{Map, Value};
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(untagged)]
pub enum JsonSchema {
Boolean(bool),
Object(Box<JsonSchemaObject>),
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(untagged)]
pub enum JsonSchemaType {
Name(String),
Names(Vec<String>),
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(untagged)]
pub enum JsonSchemaItems {
Schema(Box<JsonSchema>),
@ -23,7 +23,7 @@ pub enum JsonSchemaItems {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct JsonSchemaObject {
#[serde(rename = "type")]

View file

@ -2,7 +2,7 @@ use serde_json::{Map, Value};
use crate::formats::messages::CacheControl;
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum MinimaxMessagesContentBlock {
Image(MinimaxMediaBlock),
@ -15,7 +15,7 @@ pub enum MinimaxMessagesContentBlock {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
pub struct MinimaxMediaBlock {
pub source: MinimaxMediaSource,
pub cache_control: Option<CacheControl>,
@ -23,7 +23,7 @@ pub struct MinimaxMediaBlock {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum MinimaxMediaSource {
Base64 {
@ -40,7 +40,7 @@ pub enum MinimaxMediaSource {
}
#[serde_with::skip_serializing_none]
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Default)]
pub struct MinimaxMediaOptions {
pub detail: Option<MinimaxMediaDetail>,
@ -50,7 +50,7 @@ pub struct MinimaxMediaOptions {
pub extra: Map<String, Value>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(rename_all = "snake_case")]
pub enum MinimaxMediaDetail {
Low,

View file

@ -1,6 +1,6 @@
use serde_json::Value;
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[serde(untagged)]
pub enum Recognized<T> {
Known(T),

View file

@ -40,12 +40,12 @@ struct MetadataRow {
metadata: String,
}
#[macro_rules_attribute::apply(request_type)]
#[macro_rules_attribute::apply(crate::request_type)]
struct AttributeRow {
key: String,
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]
#[serde(untagged)]
enum PathPart {
@ -53,7 +53,7 @@ enum PathPart {
Index(usize),
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, strum::Display)]
#[serde(rename_all = "lowercase")]
#[strum(serialize_all = "lowercase")]
@ -82,13 +82,13 @@ impl JsonKind {
}
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[derive(Clone, Copy, Debug, strum::Display)]
enum MapValueType {
String,
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[cfg_attr(feature = "schema", schemars(deny_unknown_fields))]
#[cfg_attr(feature = "schema", schemars(rename = "TraceQueryMetadataField"))]
struct MetadataField {
@ -97,7 +97,7 @@ struct MetadataField {
expression: String,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[cfg_attr(feature = "schema", schemars(rename = "TraceQueryColumn"))]
struct ColumnSchema {
name: String,
@ -107,7 +107,7 @@ struct ColumnSchema {
details: BTreeMap<String, Value>,
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[cfg_attr(feature = "schema", schemars(deny_unknown_fields))]
#[cfg_attr(feature = "schema", schemars(rename = "TraceQueryTable"))]
struct TableSchema {
@ -175,7 +175,7 @@ impl<T: Serialize + Unobserved> Serialize for Discovery<T> {
}
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
struct MetadataSample {
fields: Vec<MetadataField>,
sampled_rows: usize,
@ -194,7 +194,7 @@ impl Unobserved for MetadataSample {
}
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[cfg_attr(feature = "schema", schemars(deny_unknown_fields))]
#[cfg_attr(feature = "schema", schemars(rename = "TraceQueryMetadata"))]
struct MetadataCatalog {
@ -206,7 +206,7 @@ struct MetadataCatalog {
scope: &'static str,
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[cfg_attr(feature = "schema", schemars(deny_unknown_fields))]
#[cfg_attr(feature = "schema", schemars(rename = "TraceQueryAttributeField"))]
struct AttributeField {
@ -216,7 +216,7 @@ struct AttributeField {
expression: String,
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
struct AttributeSample {
fields: Vec<AttributeField>,
truncated: bool,
@ -231,7 +231,7 @@ impl Unobserved for AttributeSample {
}
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[cfg_attr(feature = "schema", schemars(deny_unknown_fields))]
#[cfg_attr(feature = "schema", schemars(rename = "TraceQueryAttributes"))]
struct AttributeCatalog {
@ -243,7 +243,7 @@ struct AttributeCatalog {
scope: &'static str,
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[cfg_attr(feature = "schema", schemars(deny_unknown_fields))]
#[cfg_attr(feature = "schema", schemars(rename = "TraceQueryNormalizedField"))]
struct NormalizedField {
@ -267,7 +267,7 @@ impl From<&NormalizedFieldDefinition> for NormalizedField {
}
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[cfg_attr(feature = "schema", schemars(deny_unknown_fields))]
#[cfg_attr(feature = "schema", schemars(rename = "TraceQueryRelationship"))]
struct Relationship {
@ -284,7 +284,7 @@ const RELATIONSHIPS: [Relationship; 1] = [Relationship {
meaning: "LiteLLMRequestId contains the first normalized request or provider response ID. This relationship matches response IDs only; CallKeys retains all typed identifiers. Cached requests can share response_id; joins may return multiple spend rows",
}];
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[cfg_attr(feature = "schema", schemars(deny_unknown_fields))]
#[cfg_attr(feature = "schema", schemars(rename = "TraceQueryHelp"))]
pub struct QueryHelp {

View file

@ -18,7 +18,7 @@ pub const LENS_QUERIES: [litellm_traces::ReadQuery; 9] = [
litellm_traces::ReadQuery::FeedbackSummary,
];
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[serde(rename_all = "lowercase")]
pub enum ExecutionSource {
@ -27,7 +27,7 @@ pub enum ExecutionSource {
Both,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[serde(rename_all = "lowercase")]
pub enum ContentSource {
@ -35,7 +35,7 @@ pub enum ContentSource {
Requests,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[cfg_attr(feature = "schema", schemars(deny_unknown_fields))]
pub struct LensAccessParams {
@ -54,7 +54,7 @@ pub struct LensAccessParams {
pub struct LensAvailability;
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[serde(deny_unknown_fields)]
pub struct LensAvailabilityParams {
@ -62,7 +62,7 @@ pub struct LensAvailabilityParams {
pub access: LensAccessParams,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[cfg_attr(feature = "schema", schemars(rename = "ActivityAvailability"))]
pub struct LensAvailabilityRow {
@ -89,7 +89,7 @@ impl Query for LensAvailability {
pub struct LensAgents;
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[serde(deny_unknown_fields)]
pub struct LensAgentsParams {
@ -97,7 +97,7 @@ pub struct LensAgentsParams {
pub access: LensAccessParams,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[cfg_attr(feature = "schema", schemars(rename = "AgentRow"))]
pub struct LensAgentsRow {
@ -114,7 +114,7 @@ impl Query for LensAgents {
pub struct TraceAgents;
/// Same access shape as `list_traces`: every team, the caller's own traces, or their teams' traces.
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[serde(deny_unknown_fields)]
#[cfg_attr(feature = "schema", schemars(deny_unknown_fields))]
@ -138,7 +138,7 @@ pub struct TraceAgentsParams {
pub limit: u32,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[cfg_attr(feature = "schema", schemars(rename = "TraceAgentRow"))]
pub struct TraceAgentsRow {
@ -174,7 +174,7 @@ impl Query for TraceAgents {
pub struct LensSample;
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[serde(deny_unknown_fields)]
pub struct LensSampleParams {
@ -209,7 +209,7 @@ pub struct LensSampleParams {
pub offset: u64,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[cfg_attr(feature = "schema", schemars(rename = "ExecutionRow"))]
pub struct LensSampleRow {
@ -265,7 +265,7 @@ impl Query for LensSample {
pub struct LensContent;
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[serde(deny_unknown_fields)]
pub struct LensContentParams {
@ -281,7 +281,7 @@ pub struct LensContentParams {
pub offset: u32,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[cfg_attr(feature = "schema", schemars(rename = "PartRow"))]
pub struct LensContentRow {
@ -309,7 +309,7 @@ impl Query for LensContent {
pub struct LensEvidence;
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[serde(deny_unknown_fields)]
pub struct LensEvidenceParams {
@ -324,7 +324,7 @@ pub struct LensEvidenceParams {
pub quote: String,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[cfg_attr(feature = "schema", schemars(rename = "CountRow"))]
pub struct LensEvidenceRow {
@ -345,7 +345,7 @@ impl Query for LensEvidence {
pub struct LensFeedbackTarget;
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[serde(deny_unknown_fields)]
pub struct LensFeedbackTargetParams {
@ -355,7 +355,7 @@ pub struct LensFeedbackTargetParams {
pub trace_ref: String,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[cfg_attr(feature = "schema", schemars(rename = "FeedbackTargetRow"))]
pub struct LensFeedbackTargetRow {
@ -373,7 +373,7 @@ impl Query for LensFeedbackTarget {
pub struct LensFeedback;
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[serde(deny_unknown_fields)]
pub struct LensFeedbackParams {
@ -383,7 +383,7 @@ pub struct LensFeedbackParams {
pub trace_ref: String,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[cfg_attr(feature = "schema", schemars(rename = "FeedbackRow"))]
pub struct LensFeedbackRow {
@ -410,7 +410,7 @@ impl Query for LensFeedback {
pub struct LensFeedbackSummary;
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[serde(deny_unknown_fields)]
pub struct LensFeedbackSummaryParams {
@ -419,7 +419,7 @@ pub struct LensFeedbackSummaryParams {
pub trace_ids: Vec<String>,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Debug)]
#[cfg_attr(feature = "schema", schemars(rename = "FeedbackSummaryRow"))]
pub struct LensFeedbackSummaryRow {

View file

@ -1,4 +1,4 @@
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[cfg_attr(feature = "schema", schemars(rename = "TraceTableName"))]
#[derive(
Clone, Copy, Debug, strum::Display, strum::AsRefStr, strum::EnumIter, strum::IntoStaticStr,

View file

@ -29,7 +29,7 @@ use instrumentation::Instrumentation;
pub(crate) use messages::{HIDDEN_BLOCK_TYPES, MessagePayload, encode};
pub use metadata::{AgentMetadata, AgentType, Integration};
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, strum::EnumString)]
#[serde(rename_all = "lowercase")]
#[strum(serialize_all = "lowercase", ascii_case_insensitive)]

View file

@ -1,6 +1,6 @@
use askama::Template;
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[cfg_attr(feature = "schema", schemars(rename = "TraceQueryExample"))]
pub struct Example {
pub name: String,

View file

@ -1,7 +1,7 @@
use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Clone, Debug)]
#[cfg_attr(feature = "schema", schemars(rename = "TraceScope"))]
pub struct ReadAccessParams {

View file

@ -1,6 +1,6 @@
use crate::InvalidScope;
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Clone, Debug)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum QueryScope {

View file

@ -1,7 +1,7 @@
pub const TRACE_PAGE_SIZE_MIN: u16 = 1;
pub const TRACE_PAGE_SIZE_MAX: u16 = 500;
#[macro_rules_attribute::apply(request_type)]
#[macro_rules_attribute::apply(crate::request_type)]
#[derive(Clone, Debug)]
pub struct TraceListRequest {
/// Window start, unix ms. Default: 24h ago
@ -15,7 +15,7 @@ pub struct TraceListRequest {
pub cursor: Option<String>,
}
#[macro_rules_attribute::apply(request_type)]
#[macro_rules_attribute::apply(crate::request_type)]
#[derive(Clone, Debug)]
pub struct TraceDetailRequest {
#[serde(default)]
@ -31,14 +31,14 @@ pub struct TraceDetailRequest {
pub page_size: Option<u16>,
}
#[macro_rules_attribute::apply(request_type)]
#[macro_rules_attribute::apply(crate::request_type)]
#[derive(Clone, Debug)]
pub struct TraceSpanRequest {
#[serde(default)]
pub trace_ref: String,
}
#[macro_rules_attribute::apply(request_type)]
#[macro_rules_attribute::apply(crate::request_type)]
#[derive(Clone, Debug)]
pub struct TraceErrorPageRequest {
#[serde(default)]
@ -48,7 +48,7 @@ pub struct TraceErrorPageRequest {
pub cursor: Option<String>,
}
#[macro_rules_attribute::apply(request_type)]
#[macro_rules_attribute::apply(crate::request_type)]
#[derive(Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct TraceQueryRequest {

View file

@ -1,4 +1,4 @@
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[derive(Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct TraceSQLResponse {

View file

@ -1,6 +1,6 @@
/// Who sent a batch of spans. Always taken from the caller's authentication, never from span
/// attributes.
#[macro_rules_attribute::apply(request_type)]
#[macro_rules_attribute::apply(crate::request_type)]
#[derive(Clone, Debug, Default, Eq, PartialEq)]
pub struct Tenant {
pub team_id: String,

View file

@ -6,7 +6,7 @@ use serde_json::Value;
use crate::normalize::{HIDDEN_BLOCK_TYPES, MessagePayload, encode};
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[derive(Clone, Copy, Debug, PartialEq)]
#[serde(rename_all = "lowercase")]
pub enum ChatRole {
@ -16,7 +16,7 @@ pub enum ChatRole {
Tool,
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[derive(Debug, PartialEq)]
#[serde(tag = "kind", rename_all = "snake_case")]
#[cfg_attr(feature = "schema", schemars(rename = "UIContent"))]
@ -29,7 +29,7 @@ pub enum UiContent {
Text { text: String },
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[derive(Debug, PartialEq)]
#[cfg_attr(feature = "schema", schemars(rename = "UIMessage"))]
pub struct UiMessage {
@ -41,7 +41,7 @@ pub struct UiMessage {
pub tool_calls: Option<Vec<UiToolCall>>,
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[derive(Debug, PartialEq)]
#[cfg_attr(feature = "schema", schemars(rename = "UIToolCall"))]
pub struct UiToolCall {
@ -49,7 +49,7 @@ pub struct UiToolCall {
pub arguments: String,
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[derive(Debug, PartialEq)]
#[cfg_attr(feature = "schema", schemars(rename = "UIField"))]
pub struct UiField {

View file

@ -4,7 +4,7 @@ use std::collections::BTreeMap;
use crate::ui::UiContent;
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[serde(rename_all = "lowercase")]
pub enum SpanStatus {
@ -16,7 +16,7 @@ pub enum SpanStatus {
Unset,
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[derive(Clone, Debug, PartialEq)]
pub struct Span {
pub span_id: String,
@ -41,7 +41,7 @@ pub struct Span {
pub spend_match: Option<SpendMatch>,
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum SpendMatch {
@ -53,7 +53,7 @@ pub enum SpendMatch {
}
/// One distinct agent in a trace: 200 invocations of `researcher` are one node.
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[derive(Clone, Debug, PartialEq)]
pub struct AgentNode {
pub name: String,
@ -66,7 +66,7 @@ pub struct AgentNode {
pub priced_calls: u64,
}
#[macro_rules_attribute::apply(wire_type)]
#[macro_rules_attribute::apply(crate::wire_type)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum RunSourceType {
@ -81,7 +81,7 @@ pub enum RunSourceType {
}
/// The conversation that started the run, from the `agent.source.*` span attributes.
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[derive(Clone, Debug, PartialEq)]
pub struct RunSource {
#[serde(rename = "type")]
@ -94,7 +94,7 @@ pub struct RunSource {
pub user: String,
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[derive(Clone, Debug, PartialEq)]
pub struct TraceSummary {
#[cfg_attr(feature = "schema", schemars(extend("x-python-optional" = true)))]
@ -128,7 +128,7 @@ pub struct TraceSummary {
pub source: Option<RunSource>,
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[derive(Clone, Debug, PartialEq)]
pub struct Trace {
/// Read-cache metadata from gateway resolution; display estimates must not clear it.
@ -141,14 +141,14 @@ pub struct Trace {
pub next_cursor: Option<String>,
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[derive(Debug, PartialEq)]
pub struct TracePage {
pub data: Vec<TraceSummary>,
pub next_cursor: Option<String>,
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[derive(Debug, PartialEq)]
pub struct SpanDetail {
pub span_id: String,
@ -159,7 +159,7 @@ pub struct SpanDetail {
pub attributes: BTreeMap<String, String>,
}
#[macro_rules_attribute::apply(response_type)]
#[macro_rules_attribute::apply(crate::response_type)]
#[derive(Debug, PartialEq)]
pub struct SpanErrorPage {
pub span_id: String,