Commit 5cb387e
authored
✨ Update the /v1/responses endpoint (#75)
* Remove the unused auto-refresh functionality and related imports.
They are no longer needed since the underlying library issue has been resolved.
* Enhance error handling in client initialization and message sending
* Refactor link handling to extract file paths and simplify Google search links
* Fix regex pattern for Google search link matching
* Fix regex patterns for Markdown escaping, code fence and Google search link matching
* Increase timeout value in configuration files from 60 to 120 seconds to better handle heavy tasks
* Fix Image generation
* Refactor tool handling to support standard and image generation tools separately
* Fix: use "ascii" decoding for base64-encoded image data consistency
* Fix: replace `running` with `_running` for internal client status checks
* Refactor: replace direct `_running` access with `running()` method in client status checks
* Extend models with new fields for annotations, reasoning, audio, log probabilities, and token details; adjust response handling accordingly.
* Extend models with new fields (annotations, error), add `normalize_output_text` validator, rename `created` to `created_at`, and update response handling accordingly.
* Extend response models to support tool choices, image output, and improved streaming of response items. Refactor image generation handling for consistency and add compatibility with output content.
* Set default `text` value to an empty string for `ResponseOutputContent` and ensure consistent initialization in image output handling.
* feat: Add /images endpoint with dedicated router and improved image management
Add dedicated router for /images endpoint and refactor image handling logic for better modularity. Enhance temporary image management with secure naming, token verification, and cleanup functionality.
* feat: Add token-based verification for image access
* Refactor: rename image store directory to `ai_generated_images` for clarity
* fix: Update create_response to use FastAPI Request object for base_url and refactor variable handling
* fix: Correct attribute access in request_data handling within `chat.py` for tools, tool_choice, and streaming settings
* fix: Save generated images to persistent storage
* fix: Remove unused `output_image` type from `ResponseOutputContent` and update response handling for consistency
* fix: Update image URL generation in chat response to use Markdown format for compatibility1 parent ff54322 commit 5cb387e
7 files changed
+227
-70
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
10 | 15 | | |
11 | 16 | | |
12 | 17 | | |
| |||
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
| 36 | + | |
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
| |||
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
| 102 | + | |
96 | 103 | | |
97 | 104 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
25 | 31 | | |
26 | 32 | | |
27 | 33 | | |
| |||
30 | 36 | | |
31 | 37 | | |
32 | 38 | | |
| 39 | + | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
| |||
81 | 88 | | |
82 | 89 | | |
83 | 90 | | |
| 91 | + | |
| 92 | + | |
84 | 93 | | |
85 | 94 | | |
86 | 95 | | |
| |||
161 | 170 | | |
162 | 171 | | |
163 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
164 | 182 | | |
165 | 183 | | |
166 | 184 | | |
| |||
216 | 234 | | |
217 | 235 | | |
218 | 236 | | |
219 | | - | |
| 237 | + | |
| 238 | + | |
220 | 239 | | |
221 | 240 | | |
222 | 241 | | |
| |||
254 | 273 | | |
255 | 274 | | |
256 | 275 | | |
257 | | - | |
| 276 | + | |
258 | 277 | | |
259 | 278 | | |
260 | | - | |
261 | 279 | | |
262 | 280 | | |
263 | 281 | | |
264 | 282 | | |
265 | 283 | | |
| 284 | + | |
266 | 285 | | |
267 | 286 | | |
| 287 | + | |
| 288 | + | |
268 | 289 | | |
| 290 | + | |
269 | 291 | | |
270 | | - | |
271 | 292 | | |
272 | 293 | | |
273 | 294 | | |
| |||
0 commit comments