@wenathlan/getry 2.0.152 → 2.0.155

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,224 @@
1
+ /** The recorded provider wire fixtures of the gateway family as one dense typescript module: the streams, the completions, the model lists and the tags answer of the four provider shapes (anthropic, gemini, ollama and the openai compatible surface), each export holding the exact original file text of its tests root source. The localhost gateway fixture server serves them over plain http so the adapter suite and the container smoke run the full request cycle offline — no external network, no provider endpoint, no key — and the gateway tests parse the same bodies the stub transports answer. */
2
+
3
+ /** the anthropic message stream (sse events of the content block delta family) — the exact text of the former tests/anthropic-stream.txt. */
4
+ export const anthropicstream = `event: message_start
5
+ data: {"type":"message_start","message":{"id":"msg-fixture-1","role":"assistant"}}
6
+
7
+ event: content_block_start
8
+ data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}
9
+
10
+ event: content_block_delta
11
+ data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"the messages "}}
12
+
13
+ event: content_block_delta
14
+ data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"content blocks stream"}}
15
+
16
+ event: content_block_stop
17
+ data: {"type":"content_block_stop","index":0}
18
+
19
+ event: message_delta
20
+ data: {"type":"message_delta","delta":{"stop_reason":"end_turn"},"usage":{"output_tokens":12}}
21
+
22
+ event: message_stop
23
+ data: {"type":"message_stop"}
24
+
25
+ `;
26
+
27
+ /** the anthropic completion answer (the stop reason and the usage record) — the exact text of the former tests/anthropic-completion.json. */
28
+ export const anthropiccompletion = `{
29
+ "id": "msg-fixture-1",
30
+ "type": "message",
31
+ "role": "assistant",
32
+ "model": "fixture-claude-shape",
33
+ "content": [
34
+ {
35
+ "type": "text",
36
+ "text": "{\\"goal\\":\\"summarize the page\\",\\"steps\\":[{\\"kind\\":\\"extract\\",\\"target\\":\\"article\\",\\"summary\\":\\"read the article\\"}],\\"openquestions\\":[\\"which sections matter\\"]}"
37
+ }
38
+ ],
39
+ "stop_reason": "end_turn",
40
+ "usage": { "input_tokens": 47, "output_tokens": 18 }
41
+ }
42
+ `;
43
+
44
+ /** the anthropic model list (the fixture claude shapes with their context windows) — the exact text of the former tests/anthropic-models.json. */
45
+ export const anthropicmodels = `{
46
+ "data": [
47
+ {
48
+ "type": "model",
49
+ "id": "fixture-claude-shape",
50
+ "display_name": "Fixture Claude Shape",
51
+ "created_at": "2026-01-01T00:00:00Z"
52
+ },
53
+ {
54
+ "type": "model",
55
+ "id": "fixture-claude-wide",
56
+ "display_name": "Fixture Claude Wide",
57
+ "context_window": 200000,
58
+ "created_at": "2026-01-01T00:00:00Z"
59
+ }
60
+ ]
61
+ }
62
+ `;
63
+
64
+ /** the gemini generatecontent stream (the sse quoted-json chunks of the streamed answer) — the exact text of the former tests/gemini-stream.txt. */
65
+ export const geministream = `data: {"candidates":[{"content":{"parts":[{"text":"gemini "}],"role":"model"},"index":0}]}
66
+
67
+ data: {"candidates":[{"content":{"parts":[{"text":"candidate parts "}],"role":"model"},"index":0}]}
68
+
69
+ data: {"candidates":[{"content":{"parts":[{"text":"stream"}],"role":"model"},"index":0}],"finishReason":"STOP"}
70
+
71
+ `;
72
+
73
+ /** the gemini completion answer (the candidates with the finish reason) — the exact text of the former tests/gemini-completion.json. */
74
+ export const geminicompletion = `{
75
+ "candidates": [
76
+ {
77
+ "content": {
78
+ "parts": [{ "text": "{\\"goal\\":\\"answer the question\\",\\"steps\\":[],\\"openquestions\\":[]}" }],
79
+ "role": "model"
80
+ },
81
+ "finishReason": "STOP",
82
+ "index": 0
83
+ }
84
+ ],
85
+ "usageMetadata": { "promptTokenCount": 29, "candidatesTokenCount": 11, "totalTokenCount": 40 }
86
+ }
87
+ `;
88
+
89
+ /** the gemini model list (the fixture gemini shapes) — the exact text of the former tests/gemini-models.json. */
90
+ export const geminimodels = `{
91
+ "models": [
92
+ {
93
+ "name": "models/fixture-gemini-shape",
94
+ "displayName": "Fixture Gemini Shape",
95
+ "inputTokenLimit": 32768,
96
+ "outputTokenLimit": 8192,
97
+ "supportedGenerationMethods": ["generateContent", "countTokens"]
98
+ },
99
+ {
100
+ "name": "models/fixture-gemini-vision",
101
+ "displayName": "Fixture Gemini Vision",
102
+ "inputTokenLimit": 65536,
103
+ "supportedGenerationMethods": ["generateContent"]
104
+ }
105
+ ]
106
+ }
107
+ `;
108
+
109
+ /** the ollama chat stream (the ndjson lines of the streamed answer) — the exact text of the former tests/ollama-stream.txt. */
110
+ export const ollamastream = `{"model":"fixture-local:7b","created_at":"2026-01-01T00:00:00Z","message":{"role":"assistant","content":"the local "},"done":false}
111
+ {"model":"fixture-local:7b","created_at":"2026-01-01T00:00:00Z","message":{"role":"assistant","content":"runtime streams "},"done":false}
112
+ {"model":"fixture-local:7b","created_at":"2026-01-01T00:00:00Z","message":{"role":"assistant","content":"line by line"},"done":true}
113
+ `;
114
+
115
+ /** the ollama chat completion answer (the message and the done record) — the exact text of the former tests/ollama-completion.json. */
116
+ export const ollamacompletion = `{
117
+ "model": "fixture-local:7b",
118
+ "created_at": "2026-01-01T00:00:00Z",
119
+ "message": {
120
+ "role": "assistant",
121
+ "content": "{\\"goal\\":\\"run locally\\",\\"steps\\":[{\\"kind\\":\\"extract\\",\\"target\\":\\"main\\",\\"summary\\":\\"read the main region\\"}],\\"openquestions\\":[]}"
122
+ },
123
+ "done": true,
124
+ "prompt_eval_count": 40,
125
+ "eval_count": 17
126
+ }
127
+ `;
128
+
129
+ /** the ollama tags answer (the local model list with sizes and digests) — the exact text of the former tests/ollama-tags.json. */
130
+ export const ollamatags = `{
131
+ "models": [
132
+ {
133
+ "name": "fixture-local:7b",
134
+ "model": "fixture-local:7b",
135
+ "modified_at": "2026-01-01T00:00:00Z",
136
+ "size": 4100000000,
137
+ "digest": "fixture-digest-1",
138
+ "details": {
139
+ "format": "gguf",
140
+ "family": "llama",
141
+ "families": ["llama"],
142
+ "parameter_size": "7B",
143
+ "quantization_level": "Q4_0"
144
+ }
145
+ },
146
+ {
147
+ "name": "fixture-embed:latest",
148
+ "model": "fixture-embed:latest",
149
+ "modified_at": "2026-01-01T00:00:00Z",
150
+ "size": 700000000,
151
+ "digest": "fixture-digest-2",
152
+ "details": {
153
+ "format": "gguf",
154
+ "family": "nomic-bert",
155
+ "families": ["nomic-bert"],
156
+ "parameter_size": "137M",
157
+ "quantization_level": "F16"
158
+ }
159
+ }
160
+ ]
161
+ }
162
+ `;
163
+
164
+ /** the openai compatible chat stream (the sse chunks of the streamed answer) — the exact text of the former tests/openaicompat-stream.txt. */
165
+ export const openaicompatstream = `data: {"id":"chatcmpl-fixture-1","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"role":"assistant","content":"{\\"goal\\":"}}]}
166
+
167
+ data: {"id":"chatcmpl-fixture-1","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"\\"streamed answer\\","}}]}
168
+
169
+ data: {"id":"chatcmpl-fixture-1","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"\\"steps\\":[]}"}}]}
170
+
171
+ data: [DONE]
172
+
173
+ `;
174
+
175
+ /** the openai compatible chat completion answer (the choices with the message and the usage) — the exact text of the former tests/openaicompat-completion.json. */
176
+ export const openaicompatcompletion = `{
177
+ "id": "chatcmpl-fixture-1",
178
+ "object": "chat.completion",
179
+ "created": 1800000000,
180
+ "model": "fixture-model-a",
181
+ "choices": [
182
+ {
183
+ "index": 0,
184
+ "message": {
185
+ "role": "assistant",
186
+ "content": "{\\"goal\\":\\"open the docs page\\",\\"steps\\":[{\\"kind\\":\\"navigate\\",\\"target\\":\\"https://docs.example/guide\\",\\"summary\\":\\"open the guide\\"}],\\"openquestions\\":[]}"
187
+ }
188
+ }
189
+ ],
190
+ "usage": { "prompt_tokens": 34, "completion_tokens": 21, "total_tokens": 55 }
191
+ }
192
+ `;
193
+
194
+ /** the openai compatible model list (the fixture model shapes) — the exact text of the former tests/openaicompat-models.json. */
195
+ export const openaicompatmodels = `{
196
+ "object": "list",
197
+ "data": [
198
+ {
199
+ "id": "fixture-model-a",
200
+ "object": "model",
201
+ "owned_by": "fixture",
202
+ "context_length": 8192,
203
+ "modalities": ["text"]
204
+ },
205
+ { "id": "fixture-model-b", "object": "model", "owned_by": "fixture" }
206
+ ]
207
+ }
208
+ `;
209
+
210
+ /** Every provider wire fixture keyed by its original file name, so the fixture server and the adapter suite answer by name wherever a lane walks the set. */
211
+ export const providerfixtures = {
212
+ "anthropic-stream.txt": anthropicstream,
213
+ "anthropic-completion.json": anthropiccompletion,
214
+ "anthropic-models.json": anthropicmodels,
215
+ "gemini-stream.txt": geministream,
216
+ "gemini-completion.json": geminicompletion,
217
+ "gemini-models.json": geminimodels,
218
+ "ollama-stream.txt": ollamastream,
219
+ "ollama-completion.json": ollamacompletion,
220
+ "ollama-tags.json": ollamatags,
221
+ "openaicompat-stream.txt": openaicompatstream,
222
+ "openaicompat-completion.json": openaicompatcompletion,
223
+ "openaicompat-models.json": openaicompatmodels,
224
+ } as const;