-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathwire-format.json
More file actions
164 lines (164 loc) · 9.34 KB
/
Copy pathwire-format.json
File metadata and controls
164 lines (164 loc) · 9.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
[
{
"name": "tool_choice_auto",
"type": "ToolChoice",
"rust_value": "Auto",
"json": "\"auto\"",
"description": "Auto tool choice serializes as bare string"
},
{
"name": "tool_choice_none",
"type": "ToolChoice",
"rust_value": "None",
"json": "\"none\"",
"description": "None tool choice serializes as bare string"
},
{
"name": "tool_choice_required",
"type": "ToolChoice",
"rust_value": "Required",
"json": "\"required\"",
"description": "Required tool choice serializes as bare string"
},
{
"name": "tool_choice_tool",
"type": "ToolChoice",
"rust_value": "Tool { tool_name: \"get_weather\" }",
"json": "{\"type\":\"tool\",\"toolName\":\"get_weather\"}",
"description": "Tool variant serializes as tagged object with camelCase field"
},
{
"name": "stream_part_text_delta",
"type": "StreamPart",
"json": "{\"TextDelta\":{\"id\":\"tx1\",\"delta\":\"Hello\"}}",
"description": "TextDelta stream part"
},
{
"name": "stream_part_finish",
"type": "StreamPart",
"json": "{\"Finish\":{\"finish_reason\":{\"unified\":\"stop\",\"raw\":null},\"usage\":{\"input_tokens\":{\"total\":10},\"output_tokens\":{\"total\":20}},\"provider_metadata\":null}}",
"description": "Finish stream part with usage. `unified` is the bare string \"stop\" — the same shape the finish_reason_unified_stop fixture pins — not an externally-tagged object; Rust never emits the object form."
},
{
"name": "stream_part_stream_start",
"type": "StreamPart",
"json": "{\"StreamStart\":{\"warnings\":[]}}",
"description": "StreamStart with empty warnings"
},
{
"name": "stream_part_raw",
"type": "StreamPart",
"rust_value": "",
"json": "{\"Raw\":{\"raw_value\":{\"id\":\"c1\",\"choices\":[]}}}",
"description": "Raw stream part carrying the parsed JSON payload of a provider SSE event (RFC-0016 M2; emitted before parsed parts, excludes [DONE] sentinel)"
},
{
"name": "generate_text_options_default",
"type": "GenerateTextOptions",
"json": "{\"max_output_tokens\":null,\"temperature\":null,\"stop_sequences\":null,\"top_p\":null,\"top_k\":null,\"presence_penalty\":null,\"frequency_penalty\":null,\"response_format\":null,\"seed\":null,\"tools\":null,\"tool_choice\":null,\"headers\":null,\"provider_options\":null,\"reasoning\":null,\"instructions\":null,\"body_overrides\":null,\"max_retries\":null,\"timeout\":null,\"include_raw_chunks\":null}",
"description": "Default GenerateTextOptions with all fields null"
},
{
"name": "generate_text_options_with_session_id",
"type": "GenerateTextOptions",
"json": "{\"max_output_tokens\":null,\"temperature\":null,\"stop_sequences\":null,\"top_p\":null,\"top_k\":null,\"presence_penalty\":null,\"frequency_penalty\":null,\"response_format\":null,\"seed\":null,\"tools\":null,\"tool_choice\":null,\"headers\":null,\"provider_options\":null,\"reasoning\":null,\"instructions\":null,\"body_overrides\":null,\"max_retries\":null,\"timeout\":null,\"session_id\":\"sess-1\",\"include_raw_chunks\":null}",
"description": "GenerateTextOptions with explicit session_id (RFC-0024)"
},
{
"name": "generate_text_options_include_raw_chunks_true",
"type": "GenerateTextOptions",
"rust_value": "",
"json": "{\"max_output_tokens\":null,\"temperature\":null,\"stop_sequences\":null,\"top_p\":null,\"top_k\":null,\"presence_penalty\":null,\"frequency_penalty\":null,\"response_format\":null,\"seed\":null,\"tools\":null,\"tool_choice\":null,\"headers\":null,\"provider_options\":null,\"reasoning\":null,\"instructions\":null,\"body_overrides\":null,\"max_retries\":null,\"timeout\":null,\"include_raw_chunks\":true}",
"description": "GenerateTextOptions with include_raw_chunks=true (RFC-0016 M2 true-case)"
},
{
"name": "generate_text_options_numeric_types",
"type": "GenerateTextOptions",
"json": "{\"max_output_tokens\":256,\"temperature\":0.7,\"stop_sequences\":null,\"top_p\":0.95,\"top_k\":40.5,\"presence_penalty\":0.5,\"frequency_penalty\":-0.5,\"response_format\":null,\"seed\":42,\"tools\":null,\"tool_choice\":null,\"headers\":null,\"provider_options\":null,\"reasoning\":null,\"instructions\":null,\"body_overrides\":null,\"max_retries\":3,\"timeout\":null,\"include_raw_chunks\":null}",
"description": "Numeric fields carry non-null, type-discriminating values so every binding's declared types are exercised. top_k is deliberately FRACTIONAL: Rust is Option<f64> (matching the upstream AI SDK's `topK?: number`), so a binding that declares it as an integer cannot hold this value. Integer fields (max_output_tokens u32, seed u64, max_retries u32) and a negative penalty pin the signedness. This case exists to lock TYPES, not to model a realistic call."
},
{
"name": "generate_content_text",
"type": "GenerateContent",
"json": "{\"Text\":{\"text\":\"Hello\",\"provider_metadata\":{\"openai\":{\"itemId\":\"msg_1\"}}}}",
"description": "Text content with provider_metadata present. GenerateContent is externally tagged, so every binding sees a single-key object whose key is the variant name."
},
{
"name": "generate_content_text_no_metadata",
"type": "GenerateContent",
"json": "{\"Text\":{\"text\":\"Hello\"}}",
"description": "Text without provider_metadata: the key is ABSENT, not null (the field is skip_serializing_if = Option::is_none). Pins the omission so a binding that expects a required field is caught."
},
{
"name": "generate_content_reasoning_no_metadata",
"type": "GenerateContent",
"json": "{\"Reasoning\":{\"text\":\"Thinking\",\"provider_metadata\":null}}",
"description": "KNOWN ASYMMETRY, pinned deliberately: Reasoning.provider_metadata has NO skip_serializing_if, so unlike Text (see generate_content_text_no_metadata) it emits an explicit null. The two neighbouring fixtures therefore disagree on purpose — that is the drift, recorded rather than hidden. The ticket that makes the attributes symmetric must update this fixture in the same commit; if you are here because this case went red, that is the sentinel working, not a broken test."
},
{
"name": "generate_content_tool_call",
"type": "GenerateContent",
"json": "{\"ToolCall\":{\"tool_call_id\":\"call_1\",\"tool_name\":\"get_weather\",\"input\":{\"city\":\"Paris\"},\"provider_executed\":true,\"thought_signature\":\"sig_abc\"}}",
"description": "Tool call with provider_executed and thought_signature set; dynamic and provider_metadata unset and therefore absent. `input` is an object here — the ticket that moves tool-call input to a JSON string will change this fixture, which is the point."
},
{
"name": "generate_content_source",
"type": "GenerateContent",
"json": "{\"Source\":{\"id\":\"src_1\",\"source_type\":\"url\",\"url\":\"https://example.com/a\",\"title\":\"Example\"}}",
"description": "Source/citation. Note url and title carry no skip_serializing_if, so they are always emitted (null when unset) — unlike provider_metadata, which is omitted when unset."
},
{
"name": "generate_content_source_unset_optionals",
"type": "GenerateContent",
"json": "{\"Source\":{\"id\":\"src_2\",\"source_type\":\"document\",\"url\":null,\"title\":null}}",
"description": "Source with url and title unset. They carry no skip_serializing_if, so they must appear as explicit nulls — while provider_metadata, which does carry it, stays absent in the same object. Pinning the unset form is what makes that difference load-bearing: without this case, adding skip_serializing_if to url/title would silently turn null into an omitted key and no fixture would notice."
},
{
"name": "generate_content_file",
"type": "GenerateContent",
"json": "{\"File\":{\"data\":{\"Data\":{\"data\":{\"Base64\":\"aGk=\"}}},\"media_type\":\"image/png\"}}",
"description": "Generated file. `data` is a doubly-nested externally-tagged union (FileData::Data wrapping FileBytes::Base64) — the shape every binding must reproduce, and the one the four-file-variant merge will collapse."
},
{
"name": "generate_content_tool_result",
"type": "GenerateContent",
"json": "{\"ToolResult\":{\"tool_call_id\":\"call_1\",\"tool_name\":\"web_search\",\"result\":{\"answer\":42},\"is_error\":false}}",
"description": "Provider-executed tool result. is_error is false (present); preliminary, dynamic and provider_metadata are unset and absent."
},
{
"name": "timeout_configuration_values",
"type": "TimeoutConfiguration",
"json": "{\"total_ms\":5000,\"first_chunk_ms\":1000,\"chunk_ms\":500}",
"description": "TimeoutConfiguration with all three limits set (wire shape lock, RFC-0016 H3)"
},
{
"name": "role_user",
"type": "Role",
"json": "\"user\"",
"description": "User role serializes as lowercase string"
},
{
"name": "role_system",
"type": "Role",
"json": "\"system\"",
"description": "System role serializes as lowercase string"
},
{
"name": "model_message_text",
"type": "ModelMessage",
"json": "{\"role\":\"user\",\"content\":\"Hello\"}",
"description": "ModelMessage with text content"
},
{
"name": "finish_reason_unified_stop",
"type": "FinishReasonUnified",
"json": "\"stop\"",
"description": "FinishReasonUnified stop variant"
},
{
"name": "reasoning_effort_high",
"type": "ReasoningEffort",
"json": "\"high\"",
"description": "ReasoningEffort high variant"
}
]