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.
Files changed (90) hide show
  1. checksums.yaml +7 -0
  2. data/.flayignore +1 -0
  3. data/.github/workflows/ci.yml +28 -0
  4. data/.github/workflows/gitleaks.yml +23 -0
  5. data/.github/workflows/release.yml +36 -0
  6. data/.overcommit.yml +31 -0
  7. data/.rspec +2 -0
  8. data/.rubocop.yml +29 -0
  9. data/Archspec.rb +14 -0
  10. data/LICENSE +21 -0
  11. data/README.md +114 -0
  12. data/lib/ruby_llm/providers/qiniu.rb +134 -0
  13. data/models.json +859 -0
  14. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_anthropic_claude_sonnet_5_can_handle_a_multi_turn_conversation.yml +154 -0
  15. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_anthropic_claude_sonnet_5_can_have_a_basic_conversation.yml +61 -0
  16. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_anthropic_claude_sonnet_5_can_use_tools.yml +121 -0
  17. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_anthropic_claude_sonnet_5_returns_structured_output.yml +62 -0
  18. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_anthropic_claude_sonnet_5_returns_the_raw_response.yml +66 -0
  19. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_anthropic_claude_sonnet_5_supports_streaming_responses.yml +105 -0
  20. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_deepseek_deepseek_v4_1_flash_can_handle_a_multi_turn_conversation.yml +127 -0
  21. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_deepseek_deepseek_v4_1_flash_can_have_a_basic_conversation.yml +58 -0
  22. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_deepseek_deepseek_v4_1_flash_can_use_tools.yml +119 -0
  23. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_deepseek_deepseek_v4_1_flash_returns_structured_output.yml +59 -0
  24. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_deepseek_deepseek_v4_1_flash_returns_the_raw_response.yml +58 -0
  25. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_deepseek_deepseek_v4_1_flash_supports_streaming_responses.yml +89 -0
  26. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_gemini_3_1_flash_lite_preview_can_handle_a_multi_turn_conversation.yml +195 -0
  27. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_gemini_3_1_flash_lite_preview_can_have_a_basic_conversation.yml +96 -0
  28. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_gemini_3_1_flash_lite_preview_can_use_tools.yml +165 -0
  29. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_gemini_3_1_flash_lite_preview_returns_structured_output.yml +97 -0
  30. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_gemini_3_1_flash_lite_preview_returns_the_raw_response.yml +97 -0
  31. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_gemini_3_1_flash_lite_preview_supports_streaming_responses.yml +70 -0
  32. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_1_flash_lite_can_handle_a_multi_turn_conversation.yml +194 -0
  33. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_1_flash_lite_can_have_a_basic_conversation.yml +96 -0
  34. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_1_flash_lite_can_use_tools.yml +165 -0
  35. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_1_flash_lite_returns_structured_output.yml +97 -0
  36. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_1_flash_lite_returns_the_raw_response.yml +97 -0
  37. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_1_flash_lite_supports_streaming_responses.yml +70 -0
  38. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_8_flash_can_handle_a_multi_turn_conversation.yml +199 -0
  39. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_8_flash_can_have_a_basic_conversation.yml +97 -0
  40. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_8_flash_can_use_tools.yml +166 -0
  41. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_8_flash_returns_structured_output.yml +98 -0
  42. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_8_flash_returns_the_raw_response.yml +98 -0
  43. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_google_gemini_3_8_flash_supports_streaming_responses.yml +71 -0
  44. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_2_can_handle_a_multi_turn_conversation.yml +419 -0
  45. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_2_can_have_a_basic_conversation.yml +210 -0
  46. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_2_can_use_tools.yml +468 -0
  47. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_2_returns_structured_output.yml +229 -0
  48. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_2_returns_the_raw_response.yml +210 -0
  49. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_2_supports_streaming_responses.yml +102 -0
  50. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_can_handle_a_multi_turn_conversation.yml +421 -0
  51. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_can_have_a_basic_conversation.yml +157 -0
  52. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_can_use_tools.yml +469 -0
  53. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_mini_can_handle_a_multi_turn_conversation.yml +422 -0
  54. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_mini_can_have_a_basic_conversation.yml +211 -0
  55. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_mini_can_use_tools.yml +469 -0
  56. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_mini_returns_structured_output.yml +230 -0
  57. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_mini_returns_the_raw_response.yml +211 -0
  58. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_mini_supports_streaming_responses.yml +102 -0
  59. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_returns_structured_output.yml +230 -0
  60. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_returns_the_raw_response.yml +157 -0
  61. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_4_supports_streaming_responses.yml +102 -0
  62. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_6_luna_can_handle_a_multi_turn_conversation.yml +389 -0
  63. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_6_luna_can_have_a_basic_conversation.yml +241 -0
  64. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_6_luna_can_use_tools.yml +437 -0
  65. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_6_luna_returns_structured_output.yml +214 -0
  66. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_6_luna_returns_the_raw_response.yml +241 -0
  67. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_5_6_luna_supports_streaming_responses.yml +106 -0
  68. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_6_luna_can_handle_a_multi_turn_conversation.yml +389 -0
  69. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_6_luna_can_have_a_basic_conversation.yml +202 -0
  70. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_6_luna_can_use_tools.yml +437 -0
  71. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_6_luna_returns_structured_output.yml +221 -0
  72. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_6_luna_returns_the_raw_response.yml +202 -0
  73. data/spec/fixtures/vcr_cassettes/rubyllm_chat_qiniu_openai_gpt_6_luna_supports_streaming_responses.yml +112 -0
  74. data/spec/ruby_llm/chat_schema_spec.rb +30 -0
  75. data/spec/ruby_llm/chat_spec.rb +35 -0
  76. data/spec/ruby_llm/chat_streaming_spec.rb +22 -0
  77. data/spec/ruby_llm/chat_tools_spec.rb +32 -0
  78. data/spec/ruby_llm/embedding_spec.rb +49 -0
  79. data/spec/ruby_llm/image_spec.rb +23 -0
  80. data/spec/ruby_llm/models_spec.rb +11 -0
  81. data/spec/ruby_llm/moderation_spec.rb +22 -0
  82. data/spec/ruby_llm/providers/qiniu_spec.rb +103 -0
  83. data/spec/ruby_llm/rerank_spec.rb +23 -0
  84. data/spec/ruby_llm/speech_spec.rb +25 -0
  85. data/spec/ruby_llm/video_spec.rb +27 -0
  86. data/spec/spec_helper.rb +26 -0
  87. data/spec/support/models.rb +30 -0
  88. data/spec/support/rubyllm_configuration.rb +14 -0
  89. data/spec/support/vcr_configuration.rb +16 -0
  90. metadata +147 -0
@@ -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''s
9
+ 2 + 2?"}],"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-7792c1fbbe304aff882d58d91609b862
40
+ Request-Id:
41
+ - 5d9bdf35-346f-4460-bfef-733ca8a21b1e
42
+ X-Request-Id:
43
+ - 5d9bdf35-346f-4460-bfef-733ca8a21b1e
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:48 GMT
54
+ Eo-Log-Uuid:
55
+ - '2472445788057213556'
56
+ Eo-Cache-Status:
57
+ - MISS
58
+ body:
59
+ encoding: UTF-8
60
+ string: |-
61
+ {
62
+ "id": "resp_0f562b05a47506e3016aba1d49712c81969137aa465b964fcb",
63
+ "object": "response",
64
+ "created_at": 1790582089,
65
+ "status": "completed",
66
+ "background": false,
67
+ "completed_at": 1790582090,
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": 1445,
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": 10,
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_0f562b05a47506e3016aba1d4a6c24819691a5a9134c864a19",
137
+ "type": "message",
138
+ "status": "completed",
139
+ "content": [
140
+ {
141
+ "type": "output_text",
142
+ "annotations": [],
143
+ "logprobs": [],
144
+ "text": "2 + 2 = 4."
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": 12,
201
+ "output_tokens_details": {
202
+ "reasoning_tokens": 0
203
+ },
204
+ "total_tokens": 25
205
+ },
206
+ "user": null,
207
+ "metadata": {}
208
+ }
209
+ recorded_at: Mon, 28 Sep 2026 07:54:51 GMT
210
+ recorded_with: VCR 6.4.0
@@ -0,0 +1,468 @@
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''s
9
+ the weather in Berlin? Use 52.5200, 13.4050."}],"stream":false,"store":false,"include":["reasoning.encrypted_content"],"tools":[{"type":"function","name":"weather","description":"Gets
10
+ current weather for a location","parameters":{"type":"object","properties":{"latitude":{"type":"string","description":"Latitude"},"longitude":{"type":"string","description":"Longitude"}},"required":["latitude","longitude"],"additionalProperties":false,"strict":true},"strict":false}]}'
11
+ headers:
12
+ User-Agent:
13
+ - Faraday v2.14.4
14
+ Authorization:
15
+ - Bearer <AUTH_TOKEN>
16
+ Content-Type:
17
+ - application/json
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ Accept:
21
+ - "*/*"
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Access-Control-Allow-Credentials:
30
+ - 'true'
31
+ Access-Control-Allow-Headers:
32
+ - ''
33
+ Access-Control-Allow-Methods:
34
+ - GET, POST, PUT, PATCH, DELETE, OPTIONS
35
+ Access-Control-Allow-Origin:
36
+ - ''
37
+ Access-Control-Expose-Headers:
38
+ - Http_x_reqid
39
+ Http-X-Reqid:
40
+ - chatptrsp-94876acaa0124f479cad61ad425e0c94
41
+ Request-Id:
42
+ - '049aa02a-ec9d-4263-9308-81d942ddf6e0'
43
+ X-Request-Id:
44
+ - '049aa02a-ec9d-4263-9308-81d942ddf6e0'
45
+ Server:
46
+ - APISIX
47
+ Cache-Control:
48
+ - no-cache
49
+ Transfer-Encoding:
50
+ - chunked
51
+ Connection:
52
+ - keep-alive
53
+ Date:
54
+ - Mon, 28 Sep 2026 08:14:59 GMT
55
+ Eo-Log-Uuid:
56
+ - '8043978015270028828'
57
+ Eo-Cache-Status:
58
+ - MISS
59
+ body:
60
+ encoding: UTF-8
61
+ string: |-
62
+ {
63
+ "id": "resp_0ecff6ec5209fd06016aba220442dc81959bf4b543840f67a7",
64
+ "object": "response",
65
+ "created_at": 1790583300,
66
+ "status": "completed",
67
+ "background": false,
68
+ "completed_at": 1790583301,
69
+ "content_filters": [
70
+ {
71
+ "blocked": false,
72
+ "source_type": "prompt",
73
+ "content_filter_raw": [],
74
+ "content_filter_results": {
75
+ "hate": {
76
+ "filtered": false,
77
+ "severity": "safe"
78
+ },
79
+ "sexual": {
80
+ "filtered": false,
81
+ "severity": "safe"
82
+ },
83
+ "violence": {
84
+ "filtered": false,
85
+ "severity": "safe"
86
+ },
87
+ "self_harm": {
88
+ "filtered": false,
89
+ "severity": "safe"
90
+ }
91
+ },
92
+ "content_filter_offsets": {
93
+ "start_offset": 0,
94
+ "end_offset": 84,
95
+ "check_offset": 0
96
+ }
97
+ },
98
+ {
99
+ "blocked": false,
100
+ "source_type": "completion",
101
+ "content_filter_raw": [],
102
+ "content_filter_results": {
103
+ "hate": {
104
+ "filtered": false,
105
+ "severity": "safe"
106
+ },
107
+ "sexual": {
108
+ "filtered": false,
109
+ "severity": "safe"
110
+ },
111
+ "violence": {
112
+ "filtered": false,
113
+ "severity": "safe"
114
+ },
115
+ "self_harm": {
116
+ "filtered": false,
117
+ "severity": "safe"
118
+ }
119
+ },
120
+ "content_filter_offsets": {
121
+ "start_offset": 0,
122
+ "end_offset": 44,
123
+ "check_offset": 0
124
+ }
125
+ }
126
+ ],
127
+ "error": null,
128
+ "frequency_penalty": 0.0,
129
+ "incomplete_details": null,
130
+ "instructions": null,
131
+ "max_output_tokens": null,
132
+ "max_tool_calls": null,
133
+ "model": "openai/gpt-5.2",
134
+ "moderation": null,
135
+ "output": [
136
+ {
137
+ "id": "fc_0ecff6ec5209fd06016aba2204da088195ab3fe8a91d2661d7",
138
+ "type": "function_call",
139
+ "status": "completed",
140
+ "arguments": "{\"latitude\":\"52.5200\",\"longitude\":\"13.4050\"}",
141
+ "call_id": "call_PBrrIYSAH3f7443bhu2AGLrR",
142
+ "name": "weather"
143
+ }
144
+ ],
145
+ "parallel_tool_calls": true,
146
+ "presence_penalty": 0.0,
147
+ "previous_response_id": null,
148
+ "prompt_cache_key": null,
149
+ "prompt_cache_retention": "in_memory",
150
+ "reasoning": {
151
+ "context": "current_turn",
152
+ "effort": "none",
153
+ "mode": "standard",
154
+ "summary": null
155
+ },
156
+ "safety_identifier": null,
157
+ "service_tier": "default",
158
+ "store": false,
159
+ "temperature": 1.0,
160
+ "text": {
161
+ "format": {
162
+ "type": "text"
163
+ },
164
+ "verbosity": "medium"
165
+ },
166
+ "tool_choice": "auto",
167
+ "tool_usage": {
168
+ "image_gen": {
169
+ "input_tokens": 0,
170
+ "input_tokens_details": {
171
+ "image_tokens": 0,
172
+ "text_tokens": 0
173
+ },
174
+ "output_tokens": 0,
175
+ "output_tokens_details": {
176
+ "image_tokens": 0,
177
+ "text_tokens": 0
178
+ },
179
+ "total_tokens": 0
180
+ },
181
+ "web_search": {
182
+ "num_requests": 0
183
+ }
184
+ },
185
+ "tools": [
186
+ {
187
+ "type": "function",
188
+ "description": "Gets current weather for a location",
189
+ "name": "weather",
190
+ "output_schema": null,
191
+ "parameters": {
192
+ "type": "object",
193
+ "properties": {
194
+ "latitude": {
195
+ "type": "string",
196
+ "description": "Latitude"
197
+ },
198
+ "longitude": {
199
+ "type": "string",
200
+ "description": "Longitude"
201
+ }
202
+ },
203
+ "required": [
204
+ "latitude",
205
+ "longitude"
206
+ ],
207
+ "additionalProperties": false,
208
+ "strict": true
209
+ },
210
+ "strict": false
211
+ }
212
+ ],
213
+ "top_logprobs": 0,
214
+ "top_p": 0.98,
215
+ "truncation": "disabled",
216
+ "usage": {
217
+ "input_tokens": 70,
218
+ "input_tokens_details": {
219
+ "cache_write_tokens": 0,
220
+ "cached_tokens": 0
221
+ },
222
+ "output_tokens": 27,
223
+ "output_tokens_details": {
224
+ "reasoning_tokens": 0
225
+ },
226
+ "total_tokens": 97
227
+ },
228
+ "user": null,
229
+ "metadata": {}
230
+ }
231
+ recorded_at: Mon, 28 Sep 2026 08:15:01 GMT
232
+ - request:
233
+ method: post
234
+ uri: "<QINIU_BASE_URL>/bypass/openai/v1/responses"
235
+ body:
236
+ encoding: UTF-8
237
+ string: '{"model":"openai/gpt-5.2","input":[{"role":"user","content":"What''s
238
+ the weather in Berlin? Use 52.5200, 13.4050."},{"type":"function_call","call_id":"call_PBrrIYSAH3f7443bhu2AGLrR","name":"weather","arguments":"{\"latitude\":\"52.5200\",\"longitude\":\"13.4050\"}"},{"type":"function_call_output","call_id":"call_PBrrIYSAH3f7443bhu2AGLrR","output":"Current
239
+ weather at 52.5200, 13.4050: 15°C, Wind: 10 km/h"}],"stream":false,"store":false,"include":["reasoning.encrypted_content"],"tools":[{"type":"function","name":"weather","description":"Gets
240
+ current weather for a location","parameters":{"type":"object","properties":{"latitude":{"type":"string","description":"Latitude"},"longitude":{"type":"string","description":"Longitude"}},"required":["latitude","longitude"],"additionalProperties":false,"strict":true},"strict":false}]}'
241
+ headers:
242
+ User-Agent:
243
+ - Faraday v2.14.4
244
+ Authorization:
245
+ - Bearer <AUTH_TOKEN>
246
+ Content-Type:
247
+ - application/json
248
+ Accept-Encoding:
249
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
250
+ Accept:
251
+ - "*/*"
252
+ response:
253
+ status:
254
+ code: 200
255
+ message: OK
256
+ headers:
257
+ Content-Type:
258
+ - application/json; charset=utf-8
259
+ Access-Control-Allow-Credentials:
260
+ - 'true'
261
+ Access-Control-Allow-Headers:
262
+ - ''
263
+ Access-Control-Allow-Methods:
264
+ - GET, POST, PUT, PATCH, DELETE, OPTIONS
265
+ Access-Control-Allow-Origin:
266
+ - ''
267
+ Access-Control-Expose-Headers:
268
+ - Http_x_reqid
269
+ Http-X-Reqid:
270
+ - chatptrsp-145993bcde1640218cf792e22253b18d
271
+ Request-Id:
272
+ - 9175f341-f0c6-4878-84cc-8b28d027d525
273
+ X-Request-Id:
274
+ - 9175f341-f0c6-4878-84cc-8b28d027d525
275
+ Server:
276
+ - APISIX
277
+ Cache-Control:
278
+ - no-cache
279
+ Transfer-Encoding:
280
+ - chunked
281
+ Connection:
282
+ - keep-alive
283
+ Date:
284
+ - Mon, 28 Sep 2026 08:15:01 GMT
285
+ Eo-Log-Uuid:
286
+ - '4896686929328775650'
287
+ Eo-Cache-Status:
288
+ - MISS
289
+ body:
290
+ encoding: UTF-8
291
+ string: |-
292
+ {
293
+ "id": "resp_0dfb787d1e316d29016aba2206bf2c8194819b9cdfd3ee0617",
294
+ "object": "response",
295
+ "created_at": 1790583302,
296
+ "status": "completed",
297
+ "background": false,
298
+ "completed_at": 1790583306,
299
+ "content_filters": [
300
+ {
301
+ "blocked": false,
302
+ "source_type": "prompt",
303
+ "content_filter_raw": [],
304
+ "content_filter_results": {
305
+ "hate": {
306
+ "filtered": false,
307
+ "severity": "safe"
308
+ },
309
+ "sexual": {
310
+ "filtered": false,
311
+ "severity": "safe"
312
+ },
313
+ "violence": {
314
+ "filtered": false,
315
+ "severity": "safe"
316
+ },
317
+ "self_harm": {
318
+ "filtered": false,
319
+ "severity": "safe"
320
+ }
321
+ },
322
+ "content_filter_offsets": {
323
+ "start_offset": 0,
324
+ "end_offset": 173,
325
+ "check_offset": 0
326
+ }
327
+ },
328
+ {
329
+ "blocked": false,
330
+ "source_type": "completion",
331
+ "content_filter_raw": [],
332
+ "content_filter_results": {
333
+ "hate": {
334
+ "filtered": false,
335
+ "severity": "safe"
336
+ },
337
+ "sexual": {
338
+ "filtered": false,
339
+ "severity": "safe"
340
+ },
341
+ "violence": {
342
+ "filtered": false,
343
+ "severity": "safe"
344
+ },
345
+ "self_harm": {
346
+ "filtered": false,
347
+ "severity": "safe"
348
+ }
349
+ },
350
+ "content_filter_offsets": {
351
+ "start_offset": 0,
352
+ "end_offset": 73,
353
+ "check_offset": 0
354
+ }
355
+ }
356
+ ],
357
+ "error": null,
358
+ "frequency_penalty": 0.0,
359
+ "incomplete_details": null,
360
+ "instructions": null,
361
+ "max_output_tokens": null,
362
+ "max_tool_calls": null,
363
+ "model": "openai/gpt-5.2",
364
+ "moderation": null,
365
+ "output": [
366
+ {
367
+ "id": "msg_0dfb787d1e316d29016aba22079544819488332a127ceed036",
368
+ "type": "message",
369
+ "status": "completed",
370
+ "content": [
371
+ {
372
+ "type": "output_text",
373
+ "annotations": [],
374
+ "logprobs": [],
375
+ "text": "Current weather in Berlin (52.5200, 13.4050): **15\u00b0C**, **wind 10 km/h**."
376
+ }
377
+ ],
378
+ "role": "assistant"
379
+ }
380
+ ],
381
+ "parallel_tool_calls": true,
382
+ "presence_penalty": 0.0,
383
+ "previous_response_id": null,
384
+ "prompt_cache_key": null,
385
+ "prompt_cache_retention": "in_memory",
386
+ "reasoning": {
387
+ "context": "current_turn",
388
+ "effort": "none",
389
+ "mode": "standard",
390
+ "summary": null
391
+ },
392
+ "safety_identifier": null,
393
+ "service_tier": "default",
394
+ "store": false,
395
+ "temperature": 1.0,
396
+ "text": {
397
+ "format": {
398
+ "type": "text"
399
+ },
400
+ "verbosity": "medium"
401
+ },
402
+ "tool_choice": "auto",
403
+ "tool_usage": {
404
+ "image_gen": {
405
+ "input_tokens": 0,
406
+ "input_tokens_details": {
407
+ "image_tokens": 0,
408
+ "text_tokens": 0
409
+ },
410
+ "output_tokens": 0,
411
+ "output_tokens_details": {
412
+ "image_tokens": 0,
413
+ "text_tokens": 0
414
+ },
415
+ "total_tokens": 0
416
+ },
417
+ "web_search": {
418
+ "num_requests": 0
419
+ }
420
+ },
421
+ "tools": [
422
+ {
423
+ "type": "function",
424
+ "description": "Gets current weather for a location",
425
+ "name": "weather",
426
+ "output_schema": null,
427
+ "parameters": {
428
+ "type": "object",
429
+ "properties": {
430
+ "latitude": {
431
+ "type": "string",
432
+ "description": "Latitude"
433
+ },
434
+ "longitude": {
435
+ "type": "string",
436
+ "description": "Longitude"
437
+ }
438
+ },
439
+ "required": [
440
+ "latitude",
441
+ "longitude"
442
+ ],
443
+ "additionalProperties": false,
444
+ "strict": true
445
+ },
446
+ "strict": false
447
+ }
448
+ ],
449
+ "top_logprobs": 0,
450
+ "top_p": 0.98,
451
+ "truncation": "disabled",
452
+ "usage": {
453
+ "input_tokens": 129,
454
+ "input_tokens_details": {
455
+ "cache_write_tokens": 0,
456
+ "cached_tokens": 0
457
+ },
458
+ "output_tokens": 32,
459
+ "output_tokens_details": {
460
+ "reasoning_tokens": 0
461
+ },
462
+ "total_tokens": 161
463
+ },
464
+ "user": null,
465
+ "metadata": {}
466
+ }
467
+ recorded_at: Mon, 28 Sep 2026 08:15:06 GMT
468
+ recorded_with: VCR 6.4.0