ruby_llm-providers-qiniu 0.1.1
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.
- checksums.yaml +7 -0
- data/.flayignore +1 -0
- data/.github/workflows/ci.yml +28 -0
- data/.github/workflows/gitleaks.yml +23 -0
- data/.github/workflows/release.yml +36 -0
- data/.overcommit.yml +31 -0
- data/.rspec +2 -0
- data/.rubocop.yml +29 -0
- data/Archspec.rb +14 -0
- data/LICENSE +21 -0
- data/README.md +114 -0
- data/lib/ruby_llm/providers/qiniu.rb +134 -0
- data/models.json +859 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_anthropic_claude_sonnet_5_can_handle_a_multi_turn_conversation.yml +154 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_anthropic_claude_sonnet_5_can_have_a_basic_conversation.yml +61 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_anthropic_claude_sonnet_5_can_use_tools.yml +121 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_anthropic_claude_sonnet_5_returns_structured_output.yml +62 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_anthropic_claude_sonnet_5_returns_the_raw_response.yml +66 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_anthropic_claude_sonnet_5_supports_streaming_responses.yml +105 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_deepseek_deepseek_v4_1_flash_can_handle_a_multi_turn_conversation.yml +127 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_deepseek_deepseek_v4_1_flash_can_have_a_basic_conversation.yml +58 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_deepseek_deepseek_v4_1_flash_can_use_tools.yml +119 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_deepseek_deepseek_v4_1_flash_returns_structured_output.yml +59 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_deepseek_deepseek_v4_1_flash_returns_the_raw_response.yml +58 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_deepseek_deepseek_v4_1_flash_supports_streaming_responses.yml +89 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_gemini_3_1_flash_lite_preview_can_handle_a_multi_turn_conversation.yml +195 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_gemini_3_1_flash_lite_preview_can_have_a_basic_conversation.yml +96 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_gemini_3_1_flash_lite_preview_can_use_tools.yml +165 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_gemini_3_1_flash_lite_preview_returns_structured_output.yml +97 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_gemini_3_1_flash_lite_preview_returns_the_raw_response.yml +97 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_gemini_3_1_flash_lite_preview_supports_streaming_responses.yml +70 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_1_flash_lite_can_handle_a_multi_turn_conversation.yml +194 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_1_flash_lite_can_have_a_basic_conversation.yml +96 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_1_flash_lite_can_use_tools.yml +165 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_1_flash_lite_returns_structured_output.yml +97 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_1_flash_lite_returns_the_raw_response.yml +97 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_1_flash_lite_supports_streaming_responses.yml +70 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_8_flash_can_handle_a_multi_turn_conversation.yml +199 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_8_flash_can_have_a_basic_conversation.yml +97 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_8_flash_can_use_tools.yml +166 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_8_flash_returns_structured_output.yml +98 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_8_flash_returns_the_raw_response.yml +98 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_8_flash_supports_streaming_responses.yml +71 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_2_can_handle_a_multi_turn_conversation.yml +419 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_2_can_have_a_basic_conversation.yml +210 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_2_can_use_tools.yml +468 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_2_returns_structured_output.yml +229 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_2_returns_the_raw_response.yml +210 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_2_supports_streaming_responses.yml +102 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_can_handle_a_multi_turn_conversation.yml +421 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_can_have_a_basic_conversation.yml +157 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_can_use_tools.yml +469 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_mini_can_handle_a_multi_turn_conversation.yml +422 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_mini_can_have_a_basic_conversation.yml +211 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_mini_can_use_tools.yml +469 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_mini_returns_structured_output.yml +230 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_mini_returns_the_raw_response.yml +211 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_mini_supports_streaming_responses.yml +102 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_returns_structured_output.yml +230 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_returns_the_raw_response.yml +157 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_supports_streaming_responses.yml +102 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_6_luna_can_handle_a_multi_turn_conversation.yml +389 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_6_luna_can_have_a_basic_conversation.yml +241 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_6_luna_can_use_tools.yml +437 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_6_luna_returns_structured_output.yml +214 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_6_luna_returns_the_raw_response.yml +241 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_6_luna_supports_streaming_responses.yml +106 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_6_luna_can_handle_a_multi_turn_conversation.yml +389 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_6_luna_can_have_a_basic_conversation.yml +202 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_6_luna_can_use_tools.yml +437 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_6_luna_returns_structured_output.yml +221 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_6_luna_returns_the_raw_response.yml +202 -0
- data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_6_luna_supports_streaming_responses.yml +112 -0
- data/spec/ruby_llm/chat_schema_spec.rb +30 -0
- data/spec/ruby_llm/chat_spec.rb +35 -0
- data/spec/ruby_llm/chat_streaming_spec.rb +22 -0
- data/spec/ruby_llm/chat_tools_spec.rb +32 -0
- data/spec/ruby_llm/embedding_spec.rb +49 -0
- data/spec/ruby_llm/image_spec.rb +23 -0
- data/spec/ruby_llm/models_spec.rb +11 -0
- data/spec/ruby_llm/moderation_spec.rb +22 -0
- data/spec/ruby_llm/providers/qiniu_spec.rb +103 -0
- data/spec/ruby_llm/rerank_spec.rb +23 -0
- data/spec/ruby_llm/speech_spec.rb +25 -0
- data/spec/ruby_llm/video_spec.rb +27 -0
- data/spec/spec_helper.rb +26 -0
- data/spec/support/models.rb +30 -0
- data/spec/support/rubyllm_configuration.rb +14 -0
- data/spec/support/vcr_configuration.rb +16 -0
- metadata +147 -0
data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_2_returns_structured_output.yml
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: post
|
|
5
|
+
uri: "<QINIU_BASE_URL>/bypass/openai/v1/responses"
|
|
6
|
+
body:
|
|
7
|
+
encoding: UTF-8
|
|
8
|
+
string: '{"model":"openai/gpt-5.2","input":[{"role":"user","content":"Generate
|
|
9
|
+
a person named John who is 30 years old"}],"stream":false,"store":false,"include":["reasoning.encrypted_content"],"text":{"format":{"type":"json_schema","name":"response","schema":{"type":"object","properties":{"name":{"type":"string"},"age":{"type":"integer"}},"required":["name","age"],"additionalProperties":false},"strict":true}}}'
|
|
10
|
+
headers:
|
|
11
|
+
User-Agent:
|
|
12
|
+
- Faraday v2.14.4
|
|
13
|
+
Authorization:
|
|
14
|
+
- Bearer <AUTH_TOKEN>
|
|
15
|
+
Content-Type:
|
|
16
|
+
- application/json
|
|
17
|
+
Accept-Encoding:
|
|
18
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
19
|
+
Accept:
|
|
20
|
+
- "*/*"
|
|
21
|
+
response:
|
|
22
|
+
status:
|
|
23
|
+
code: 200
|
|
24
|
+
message: OK
|
|
25
|
+
headers:
|
|
26
|
+
Content-Type:
|
|
27
|
+
- application/json; charset=utf-8
|
|
28
|
+
Access-Control-Allow-Credentials:
|
|
29
|
+
- 'true'
|
|
30
|
+
Access-Control-Allow-Headers:
|
|
31
|
+
- ''
|
|
32
|
+
Access-Control-Allow-Methods:
|
|
33
|
+
- GET, POST, PUT, PATCH, DELETE, OPTIONS
|
|
34
|
+
Access-Control-Allow-Origin:
|
|
35
|
+
- ''
|
|
36
|
+
Access-Control-Expose-Headers:
|
|
37
|
+
- Http_x_reqid
|
|
38
|
+
Http-X-Reqid:
|
|
39
|
+
- chatptrsp-15bb71253ab74c788830cb8d4d576778
|
|
40
|
+
Request-Id:
|
|
41
|
+
- d1df3a9f-c9ec-4c77-a4b2-ed95c2da8674
|
|
42
|
+
X-Request-Id:
|
|
43
|
+
- d1df3a9f-c9ec-4c77-a4b2-ed95c2da8674
|
|
44
|
+
Server:
|
|
45
|
+
- APISIX
|
|
46
|
+
Cache-Control:
|
|
47
|
+
- no-cache
|
|
48
|
+
Transfer-Encoding:
|
|
49
|
+
- chunked
|
|
50
|
+
Connection:
|
|
51
|
+
- keep-alive
|
|
52
|
+
Date:
|
|
53
|
+
- Mon, 28 Sep 2026 07:53:26 GMT
|
|
54
|
+
Eo-Log-Uuid:
|
|
55
|
+
- '9033901438792798554'
|
|
56
|
+
Eo-Cache-Status:
|
|
57
|
+
- MISS
|
|
58
|
+
body:
|
|
59
|
+
encoding: UTF-8
|
|
60
|
+
string: |-
|
|
61
|
+
{
|
|
62
|
+
"id": "resp_05d5cdd9b9f3cf1d016aba1cf7159881909eab7e7334abe29c",
|
|
63
|
+
"object": "response",
|
|
64
|
+
"created_at": 1790582007,
|
|
65
|
+
"status": "completed",
|
|
66
|
+
"background": false,
|
|
67
|
+
"completed_at": 1790582008,
|
|
68
|
+
"content_filters": [
|
|
69
|
+
{
|
|
70
|
+
"blocked": false,
|
|
71
|
+
"source_type": "prompt",
|
|
72
|
+
"content_filter_raw": [],
|
|
73
|
+
"content_filter_results": {
|
|
74
|
+
"hate": {
|
|
75
|
+
"filtered": false,
|
|
76
|
+
"severity": "safe"
|
|
77
|
+
},
|
|
78
|
+
"sexual": {
|
|
79
|
+
"filtered": false,
|
|
80
|
+
"severity": "safe"
|
|
81
|
+
},
|
|
82
|
+
"violence": {
|
|
83
|
+
"filtered": false,
|
|
84
|
+
"severity": "safe"
|
|
85
|
+
},
|
|
86
|
+
"self_harm": {
|
|
87
|
+
"filtered": false,
|
|
88
|
+
"severity": "safe"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"content_filter_offsets": {
|
|
92
|
+
"start_offset": 0,
|
|
93
|
+
"end_offset": 1621,
|
|
94
|
+
"check_offset": 0
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"blocked": false,
|
|
99
|
+
"source_type": "completion",
|
|
100
|
+
"content_filter_raw": [],
|
|
101
|
+
"content_filter_results": {
|
|
102
|
+
"hate": {
|
|
103
|
+
"filtered": false,
|
|
104
|
+
"severity": "safe"
|
|
105
|
+
},
|
|
106
|
+
"sexual": {
|
|
107
|
+
"filtered": false,
|
|
108
|
+
"severity": "safe"
|
|
109
|
+
},
|
|
110
|
+
"violence": {
|
|
111
|
+
"filtered": false,
|
|
112
|
+
"severity": "safe"
|
|
113
|
+
},
|
|
114
|
+
"self_harm": {
|
|
115
|
+
"filtered": false,
|
|
116
|
+
"severity": "safe"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"content_filter_offsets": {
|
|
120
|
+
"start_offset": 0,
|
|
121
|
+
"end_offset": 24,
|
|
122
|
+
"check_offset": 0
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"error": null,
|
|
127
|
+
"frequency_penalty": 0.0,
|
|
128
|
+
"incomplete_details": null,
|
|
129
|
+
"instructions": null,
|
|
130
|
+
"max_output_tokens": null,
|
|
131
|
+
"max_tool_calls": null,
|
|
132
|
+
"model": "openai/gpt-5.2",
|
|
133
|
+
"moderation": null,
|
|
134
|
+
"output": [
|
|
135
|
+
{
|
|
136
|
+
"id": "msg_05d5cdd9b9f3cf1d016aba1cf7b0508190a3fd5b0f131e7e25",
|
|
137
|
+
"type": "message",
|
|
138
|
+
"status": "completed",
|
|
139
|
+
"content": [
|
|
140
|
+
{
|
|
141
|
+
"type": "output_text",
|
|
142
|
+
"annotations": [],
|
|
143
|
+
"logprobs": [],
|
|
144
|
+
"text": "{\"name\":\"John\",\"age\":30}"
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"role": "assistant"
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
"parallel_tool_calls": true,
|
|
151
|
+
"presence_penalty": 0.0,
|
|
152
|
+
"previous_response_id": null,
|
|
153
|
+
"prompt_cache_key": null,
|
|
154
|
+
"prompt_cache_retention": "in_memory",
|
|
155
|
+
"reasoning": {
|
|
156
|
+
"context": "current_turn",
|
|
157
|
+
"effort": "none",
|
|
158
|
+
"mode": "standard",
|
|
159
|
+
"summary": null
|
|
160
|
+
},
|
|
161
|
+
"safety_identifier": null,
|
|
162
|
+
"service_tier": "default",
|
|
163
|
+
"store": false,
|
|
164
|
+
"temperature": 1.0,
|
|
165
|
+
"text": {
|
|
166
|
+
"format": {
|
|
167
|
+
"type": "json_schema",
|
|
168
|
+
"description": null,
|
|
169
|
+
"name": "response",
|
|
170
|
+
"schema": {
|
|
171
|
+
"type": "object",
|
|
172
|
+
"properties": {
|
|
173
|
+
"name": {
|
|
174
|
+
"type": "string"
|
|
175
|
+
},
|
|
176
|
+
"age": {
|
|
177
|
+
"type": "integer"
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"required": [
|
|
181
|
+
"name",
|
|
182
|
+
"age"
|
|
183
|
+
],
|
|
184
|
+
"additionalProperties": false
|
|
185
|
+
},
|
|
186
|
+
"strict": true
|
|
187
|
+
},
|
|
188
|
+
"verbosity": "medium"
|
|
189
|
+
},
|
|
190
|
+
"tool_choice": "auto",
|
|
191
|
+
"tool_usage": {
|
|
192
|
+
"image_gen": {
|
|
193
|
+
"input_tokens": 0,
|
|
194
|
+
"input_tokens_details": {
|
|
195
|
+
"image_tokens": 0,
|
|
196
|
+
"text_tokens": 0
|
|
197
|
+
},
|
|
198
|
+
"output_tokens": 0,
|
|
199
|
+
"output_tokens_details": {
|
|
200
|
+
"image_tokens": 0,
|
|
201
|
+
"text_tokens": 0
|
|
202
|
+
},
|
|
203
|
+
"total_tokens": 0
|
|
204
|
+
},
|
|
205
|
+
"web_search": {
|
|
206
|
+
"num_requests": 0
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"tools": [],
|
|
210
|
+
"top_logprobs": 0,
|
|
211
|
+
"top_p": 0.98,
|
|
212
|
+
"truncation": "disabled",
|
|
213
|
+
"usage": {
|
|
214
|
+
"input_tokens": 45,
|
|
215
|
+
"input_tokens_details": {
|
|
216
|
+
"cache_write_tokens": 0,
|
|
217
|
+
"cached_tokens": 0
|
|
218
|
+
},
|
|
219
|
+
"output_tokens": 16,
|
|
220
|
+
"output_tokens_details": {
|
|
221
|
+
"reasoning_tokens": 0
|
|
222
|
+
},
|
|
223
|
+
"total_tokens": 61
|
|
224
|
+
},
|
|
225
|
+
"user": null,
|
|
226
|
+
"metadata": {}
|
|
227
|
+
}
|
|
228
|
+
recorded_at: Mon, 28 Sep 2026 07:53:28 GMT
|
|
229
|
+
recorded_with: VCR 6.4.0
|
data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_2_returns_the_raw_response.yml
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: post
|
|
5
|
+
uri: "<QINIU_BASE_URL>/bypass/openai/v1/responses"
|
|
6
|
+
body:
|
|
7
|
+
encoding: UTF-8
|
|
8
|
+
string: '{"model":"openai/gpt-5.2","input":[{"role":"user","content":"What is
|
|
9
|
+
the capital of France?"}],"stream":false,"store":false,"include":["reasoning.encrypted_content"]}'
|
|
10
|
+
headers:
|
|
11
|
+
User-Agent:
|
|
12
|
+
- Faraday v2.14.4
|
|
13
|
+
Authorization:
|
|
14
|
+
- Bearer <AUTH_TOKEN>
|
|
15
|
+
Content-Type:
|
|
16
|
+
- application/json
|
|
17
|
+
Accept-Encoding:
|
|
18
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
19
|
+
Accept:
|
|
20
|
+
- "*/*"
|
|
21
|
+
response:
|
|
22
|
+
status:
|
|
23
|
+
code: 200
|
|
24
|
+
message: OK
|
|
25
|
+
headers:
|
|
26
|
+
Content-Type:
|
|
27
|
+
- application/json; charset=utf-8
|
|
28
|
+
Access-Control-Allow-Credentials:
|
|
29
|
+
- 'true'
|
|
30
|
+
Access-Control-Allow-Headers:
|
|
31
|
+
- ''
|
|
32
|
+
Access-Control-Allow-Methods:
|
|
33
|
+
- GET, POST, PUT, PATCH, DELETE, OPTIONS
|
|
34
|
+
Access-Control-Allow-Origin:
|
|
35
|
+
- ''
|
|
36
|
+
Access-Control-Expose-Headers:
|
|
37
|
+
- Http_x_reqid
|
|
38
|
+
Http-X-Reqid:
|
|
39
|
+
- chatptrsp-f7ed5f23629a45c7a203227991cd0b88
|
|
40
|
+
Request-Id:
|
|
41
|
+
- 26b7bab1-580c-41a6-8ca9-bc18a9d21a4f
|
|
42
|
+
X-Request-Id:
|
|
43
|
+
- 26b7bab1-580c-41a6-8ca9-bc18a9d21a4f
|
|
44
|
+
Server:
|
|
45
|
+
- APISIX
|
|
46
|
+
Cache-Control:
|
|
47
|
+
- no-cache
|
|
48
|
+
Transfer-Encoding:
|
|
49
|
+
- chunked
|
|
50
|
+
Connection:
|
|
51
|
+
- keep-alive
|
|
52
|
+
Date:
|
|
53
|
+
- Mon, 28 Sep 2026 07:54:53 GMT
|
|
54
|
+
Eo-Log-Uuid:
|
|
55
|
+
- '9395924990694622063'
|
|
56
|
+
Eo-Cache-Status:
|
|
57
|
+
- MISS
|
|
58
|
+
body:
|
|
59
|
+
encoding: UTF-8
|
|
60
|
+
string: |-
|
|
61
|
+
{
|
|
62
|
+
"id": "resp_03bce165a379cbdb016aba1d4e8984819086f7fb59c6e6b55a",
|
|
63
|
+
"object": "response",
|
|
64
|
+
"created_at": 1790582094,
|
|
65
|
+
"status": "completed",
|
|
66
|
+
"background": false,
|
|
67
|
+
"completed_at": 1790582095,
|
|
68
|
+
"content_filters": [
|
|
69
|
+
{
|
|
70
|
+
"blocked": false,
|
|
71
|
+
"source_type": "prompt",
|
|
72
|
+
"content_filter_raw": [],
|
|
73
|
+
"content_filter_results": {
|
|
74
|
+
"hate": {
|
|
75
|
+
"filtered": false,
|
|
76
|
+
"severity": "safe"
|
|
77
|
+
},
|
|
78
|
+
"sexual": {
|
|
79
|
+
"filtered": false,
|
|
80
|
+
"severity": "safe"
|
|
81
|
+
},
|
|
82
|
+
"violence": {
|
|
83
|
+
"filtered": false,
|
|
84
|
+
"severity": "safe"
|
|
85
|
+
},
|
|
86
|
+
"self_harm": {
|
|
87
|
+
"filtered": false,
|
|
88
|
+
"severity": "safe"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"content_filter_offsets": {
|
|
92
|
+
"start_offset": 0,
|
|
93
|
+
"end_offset": 1462,
|
|
94
|
+
"check_offset": 0
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"blocked": false,
|
|
99
|
+
"source_type": "completion",
|
|
100
|
+
"content_filter_raw": [],
|
|
101
|
+
"content_filter_results": {
|
|
102
|
+
"hate": {
|
|
103
|
+
"filtered": false,
|
|
104
|
+
"severity": "safe"
|
|
105
|
+
},
|
|
106
|
+
"sexual": {
|
|
107
|
+
"filtered": false,
|
|
108
|
+
"severity": "safe"
|
|
109
|
+
},
|
|
110
|
+
"violence": {
|
|
111
|
+
"filtered": false,
|
|
112
|
+
"severity": "safe"
|
|
113
|
+
},
|
|
114
|
+
"self_harm": {
|
|
115
|
+
"filtered": false,
|
|
116
|
+
"severity": "safe"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"content_filter_offsets": {
|
|
120
|
+
"start_offset": 0,
|
|
121
|
+
"end_offset": 6,
|
|
122
|
+
"check_offset": 0
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"error": null,
|
|
127
|
+
"frequency_penalty": 0.0,
|
|
128
|
+
"incomplete_details": null,
|
|
129
|
+
"instructions": null,
|
|
130
|
+
"max_output_tokens": null,
|
|
131
|
+
"max_tool_calls": null,
|
|
132
|
+
"model": "openai/gpt-5.2",
|
|
133
|
+
"moderation": null,
|
|
134
|
+
"output": [
|
|
135
|
+
{
|
|
136
|
+
"id": "msg_03bce165a379cbdb016aba1d4f66bc8190a3ae12f9f957680b",
|
|
137
|
+
"type": "message",
|
|
138
|
+
"status": "completed",
|
|
139
|
+
"content": [
|
|
140
|
+
{
|
|
141
|
+
"type": "output_text",
|
|
142
|
+
"annotations": [],
|
|
143
|
+
"logprobs": [],
|
|
144
|
+
"text": "Paris."
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"role": "assistant"
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
"parallel_tool_calls": true,
|
|
151
|
+
"presence_penalty": 0.0,
|
|
152
|
+
"previous_response_id": null,
|
|
153
|
+
"prompt_cache_key": null,
|
|
154
|
+
"prompt_cache_retention": "in_memory",
|
|
155
|
+
"reasoning": {
|
|
156
|
+
"context": "current_turn",
|
|
157
|
+
"effort": "none",
|
|
158
|
+
"mode": "standard",
|
|
159
|
+
"summary": null
|
|
160
|
+
},
|
|
161
|
+
"safety_identifier": null,
|
|
162
|
+
"service_tier": "default",
|
|
163
|
+
"store": false,
|
|
164
|
+
"temperature": 1.0,
|
|
165
|
+
"text": {
|
|
166
|
+
"format": {
|
|
167
|
+
"type": "text"
|
|
168
|
+
},
|
|
169
|
+
"verbosity": "medium"
|
|
170
|
+
},
|
|
171
|
+
"tool_choice": "auto",
|
|
172
|
+
"tool_usage": {
|
|
173
|
+
"image_gen": {
|
|
174
|
+
"input_tokens": 0,
|
|
175
|
+
"input_tokens_details": {
|
|
176
|
+
"image_tokens": 0,
|
|
177
|
+
"text_tokens": 0
|
|
178
|
+
},
|
|
179
|
+
"output_tokens": 0,
|
|
180
|
+
"output_tokens_details": {
|
|
181
|
+
"image_tokens": 0,
|
|
182
|
+
"text_tokens": 0
|
|
183
|
+
},
|
|
184
|
+
"total_tokens": 0
|
|
185
|
+
},
|
|
186
|
+
"web_search": {
|
|
187
|
+
"num_requests": 0
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"tools": [],
|
|
191
|
+
"top_logprobs": 0,
|
|
192
|
+
"top_p": 0.98,
|
|
193
|
+
"truncation": "disabled",
|
|
194
|
+
"usage": {
|
|
195
|
+
"input_tokens": 13,
|
|
196
|
+
"input_tokens_details": {
|
|
197
|
+
"cache_write_tokens": 0,
|
|
198
|
+
"cached_tokens": 0
|
|
199
|
+
},
|
|
200
|
+
"output_tokens": 6,
|
|
201
|
+
"output_tokens_details": {
|
|
202
|
+
"reasoning_tokens": 0
|
|
203
|
+
},
|
|
204
|
+
"total_tokens": 19
|
|
205
|
+
},
|
|
206
|
+
"user": null,
|
|
207
|
+
"metadata": {}
|
|
208
|
+
}
|
|
209
|
+
recorded_at: Mon, 28 Sep 2026 07:54:56 GMT
|
|
210
|
+
recorded_with: VCR 6.4.0
|
data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_2_supports_streaming_responses.yml
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: post
|
|
5
|
+
uri: "<QINIU_BASE_URL>/bypass/openai/v1/responses"
|
|
6
|
+
body:
|
|
7
|
+
encoding: UTF-8
|
|
8
|
+
string: '{"model":"openai/gpt-5.2","input":[{"role":"user","content":"Count
|
|
9
|
+
from 1 to 3"}],"stream":true,"store":false,"include":["reasoning.encrypted_content"]}'
|
|
10
|
+
headers:
|
|
11
|
+
User-Agent:
|
|
12
|
+
- Faraday v2.14.4
|
|
13
|
+
Authorization:
|
|
14
|
+
- Bearer <AUTH_TOKEN>
|
|
15
|
+
Content-Type:
|
|
16
|
+
- application/json
|
|
17
|
+
Accept-Encoding:
|
|
18
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
19
|
+
Accept:
|
|
20
|
+
- "*/*"
|
|
21
|
+
response:
|
|
22
|
+
status:
|
|
23
|
+
code: 200
|
|
24
|
+
message: OK
|
|
25
|
+
headers:
|
|
26
|
+
Content-Type:
|
|
27
|
+
- text/event-stream
|
|
28
|
+
Access-Control-Allow-Credentials:
|
|
29
|
+
- 'true'
|
|
30
|
+
Access-Control-Allow-Headers:
|
|
31
|
+
- ''
|
|
32
|
+
Access-Control-Allow-Methods:
|
|
33
|
+
- GET, POST, PUT, PATCH, DELETE, OPTIONS
|
|
34
|
+
Access-Control-Allow-Origin:
|
|
35
|
+
- ''
|
|
36
|
+
Access-Control-Expose-Headers:
|
|
37
|
+
- Http_x_reqid
|
|
38
|
+
Http-X-Reqid:
|
|
39
|
+
- chatptrsp-465384d90c8f47e9bdc5337c06c52cb9
|
|
40
|
+
Request-Id:
|
|
41
|
+
- f1af6622-1bd4-456f-ae08-4e77db6fa0f9
|
|
42
|
+
X-Request-Id:
|
|
43
|
+
- f1af6622-1bd4-456f-ae08-4e77db6fa0f9
|
|
44
|
+
Server:
|
|
45
|
+
- APISIX
|
|
46
|
+
Cache-Control:
|
|
47
|
+
- no-cache
|
|
48
|
+
Transfer-Encoding:
|
|
49
|
+
- chunked
|
|
50
|
+
Connection:
|
|
51
|
+
- keep-alive
|
|
52
|
+
Date:
|
|
53
|
+
- Mon, 28 Sep 2026 07:50:36 GMT
|
|
54
|
+
Eo-Log-Uuid:
|
|
55
|
+
- '15970643449825255651'
|
|
56
|
+
Eo-Cache-Status:
|
|
57
|
+
- MISS
|
|
58
|
+
body:
|
|
59
|
+
encoding: UTF-8
|
|
60
|
+
string: |+
|
|
61
|
+
event: response.created
|
|
62
|
+
data: {"type":"response.created","response":{"id":"resp_030cb5db49c44eec016aba1c4e1d748194b42c251237fe059c","object":"response","created_at":1790581838,"status":"in_progress","background":false,"completed_at":null,"content_filters":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"openai/gpt-5.2","moderation":null,"output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"context":"current_turn","effort":"none","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":0}
|
|
63
|
+
|
|
64
|
+
event: response.in_progress
|
|
65
|
+
data: {"type":"response.in_progress","response":{"id":"resp_030cb5db49c44eec016aba1c4e1d748194b42c251237fe059c","object":"response","created_at":1790581838,"status":"in_progress","background":false,"completed_at":null,"content_filters":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"openai/gpt-5.2","moderation":null,"output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"context":"current_turn","effort":"none","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":1}
|
|
66
|
+
|
|
67
|
+
event: response.output_item.added
|
|
68
|
+
data: {"type":"response.output_item.added","item":{"id":"msg_030cb5db49c44eec016aba1c4edad08194aa471398d1251121","type":"message","status":"in_progress","content":[],"role":"assistant"},"output_index":0,"sequence_number":2}
|
|
69
|
+
|
|
70
|
+
event: response.content_part.added
|
|
71
|
+
data: {"type":"response.content_part.added","content_index":0,"item_id":"msg_030cb5db49c44eec016aba1c4edad08194aa471398d1251121","output_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":""},"sequence_number":3}
|
|
72
|
+
|
|
73
|
+
event: response.output_text.delta
|
|
74
|
+
data: {"type":"response.output_text.delta","content_index":0,"delta":"1","item_id":"msg_030cb5db49c44eec016aba1c4edad08194aa471398d1251121","logprobs":[],"obfuscation":"MvmMOsKu5dSQh9q","output_index":0,"sequence_number":4}
|
|
75
|
+
|
|
76
|
+
event: response.output_text.delta
|
|
77
|
+
data: {"type":"response.output_text.delta","content_index":0,"delta":" \n","item_id":"msg_030cb5db49c44eec016aba1c4edad08194aa471398d1251121","logprobs":[],"obfuscation":"zNV8fEGxsRBHw","output_index":0,"sequence_number":5}
|
|
78
|
+
|
|
79
|
+
event: response.output_text.delta
|
|
80
|
+
data: {"type":"response.output_text.delta","content_index":0,"delta":"2","item_id":"msg_030cb5db49c44eec016aba1c4edad08194aa471398d1251121","logprobs":[],"obfuscation":"hgFS144DZRoQ6Gz","output_index":0,"sequence_number":6}
|
|
81
|
+
|
|
82
|
+
event: response.output_text.delta
|
|
83
|
+
data: {"type":"response.output_text.delta","content_index":0,"delta":" \n","item_id":"msg_030cb5db49c44eec016aba1c4edad08194aa471398d1251121","logprobs":[],"obfuscation":"WIrSeb6DW8EYv","output_index":0,"sequence_number":7}
|
|
84
|
+
|
|
85
|
+
event: response.output_text.delta
|
|
86
|
+
data: {"type":"response.output_text.delta","content_index":0,"delta":"3","item_id":"msg_030cb5db49c44eec016aba1c4edad08194aa471398d1251121","logprobs":[],"obfuscation":"U565XGgK7cz0xut","output_index":0,"sequence_number":8}
|
|
87
|
+
|
|
88
|
+
event: response.output_text.done
|
|
89
|
+
data: {"type":"response.output_text.done","content_index":0,"item_id":"msg_030cb5db49c44eec016aba1c4edad08194aa471398d1251121","logprobs":[],"output_index":0,"sequence_number":9,"text":"1 \n2 \n3"}
|
|
90
|
+
|
|
91
|
+
event: response.content_part.done
|
|
92
|
+
data: {"type":"response.content_part.done","content_index":0,"item_id":"msg_030cb5db49c44eec016aba1c4edad08194aa471398d1251121","output_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":"1 \n2 \n3"},"sequence_number":10}
|
|
93
|
+
|
|
94
|
+
event: response.output_item.done
|
|
95
|
+
data: {"type":"response.output_item.done","item":{"id":"msg_030cb5db49c44eec016aba1c4edad08194aa471398d1251121","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"1 \n2 \n3"}],"role":"assistant"},"output_index":0,"sequence_number":11}
|
|
96
|
+
|
|
97
|
+
event: response.completed
|
|
98
|
+
data: {"type":"response.completed","response":{"id":"resp_030cb5db49c44eec016aba1c4e1d748194b42c251237fe059c","object":"response","created_at":1790581838,"status":"completed","background":false,"completed_at":1790581838,"content_filters":[{"blocked":false,"source_type":"prompt","content_filter_raw":[],"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"},"self_harm":{"filtered":false,"severity":"safe"}},"content_filter_offsets":{"start_offset":0,"end_offset":1449,"check_offset":0}},{"blocked":false,"source_type":"completion","content_filter_raw":[],"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"},"self_harm":{"filtered":false,"severity":"safe"}},"content_filter_offsets":{"start_offset":0,"end_offset":9,"check_offset":0}}],"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"max_tool_calls":null,"model":"openai/gpt-5.2","moderation":null,"output":[{"id":"msg_030cb5db49c44eec016aba1c4edad08194aa471398d1251121","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"1 \n2 \n3"}],"role":"assistant"}],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"context":"current_turn","effort":"none","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":{"input_tokens":13,"input_tokens_details":{"cache_write_tokens":0,"cached_tokens":0},"output_tokens":9,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":22},"user":null,"metadata":{}},"sequence_number":12}
|
|
99
|
+
|
|
100
|
+
recorded_at: Mon, 28 Sep 2026 07:50:39 GMT
|
|
101
|
+
recorded_with: VCR 6.4.0
|
|
102
|
+
...
|