Commit 526eb11
committed
Release v0.8.8: Extract shared utilities and remove dead code
Consolidate duplicated helper functions into dedicated utility modules
and remove unused code paths discovered during codebase audit.
New utility modules:
lib/gemini/utils/map_helpers.ex
- maybe_put/3: conditionally add to map if value not nil
- maybe_put_non_empty/3: skip nil and empty strings
- maybe_put_non_zero/3: skip nil and zero values
- build_paginated_path/2: construct paths with pagination params
- add_query_param/3: conditionally add query parameters
lib/gemini/utils/polling_helpers.ex
- timed_out?/2: check if polling operation exceeded timeout
- maybe_add/3: conditionally add to keyword list
Modules updated to use shared utilities:
- Gemini.APIs.Batches
- Gemini.APIs.Documents
- Gemini.APIs.FileSearchStores
- Gemini.APIs.Files
- Gemini.APIs.Interactions
- Gemini.APIs.Operations
- Gemini.APIs.RagStores
- Gemini.APIs.Tunings
- Gemini.APIs.Videos
- Gemini.Auth.MultiAuthCoordinator
- Gemini.Config
- Gemini.RateLimiter.RetryManager
- Gemini.Types.Generation.Video
- Gemini.Types.Interactions.* (content, config, delta, events, etc.)
- Gemini.Types.Request.* (embed content types)
- Gemini.Types.Schema
- Gemini.Types.Tuning
Removed dead code:
Gemini.Auth
- authenticate/2 and base_url/2 delegators (unused)
Gemini.Auth.GeminiStrategy
- authenticate/1 (headers/1 is the actual interface)
Gemini.Auth.MultiAuthCoordinator
- Unused struct definition
Gemini.Client
- stream_post/2 and stream_post_with_auth/4
- Streaming moved to HTTPStreaming module
Gemini.Client.HTTP
- All SSE streaming functions (parse_sse_stream, handle_stream_*)
- Module now focused on regular HTTP requests only
Gemini.Config
- models/0, use_case_models/0, use_case_token_minima/0
- model_for_use_case/2, resolved_use_case_models/1
Gemini.RateLimiter.ConcurrencyGate
- reset/1 (reset_all/0 sufficient for testing)
Gemini.RateLimiter.Config
- adaptive_enabled?/1, profile_config/1
Gemini.RateLimiter.State
- would_exceed_budget?/3
Gemini.Streaming.ToolOrchestrator
- subscribe/2, stop/1, cleanup_streams/1
Deleted files:
- lib/gemini/types/interactions/params.ex (unused parameter structs)
- lib/gemini/types/live.ex (unused Live API types)
- test/gemini/auth/vertex_strategy_test_old.exs (stale test file)
Test updates:
- gemini_strategy_test.exs now tests headers/1 interface
- auth_test.exs uses build_headers/2 instead of authenticate/2
- Removed tests for deleted would_exceed_budget?/3 function1 parent 0536dee commit 526eb11
File tree
43 files changed
+635
-1381
lines changed- docs/guides
- lib/gemini
- apis
- auth
- client
- rate_limiter
- streaming
- types
- generation
- interactions
- request
- utils
- test/gemini
- auth
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
43 files changed
+635
-1381
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 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 | + | |
8 | 74 | | |
9 | 75 | | |
10 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| 90 | + | |
90 | 91 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
96 | 109 | | |
97 | 110 | | |
98 | 111 | | |
99 | 112 | | |
100 | 113 | | |
101 | 114 | | |
102 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
103 | 118 | | |
104 | 119 | | |
105 | 120 | | |
| |||
110 | 125 | | |
111 | 126 | | |
112 | 127 | | |
113 | | - | |
| 128 | + | |
114 | 129 | | |
115 | 130 | | |
116 | 131 | | |
| |||
126 | 141 | | |
127 | 142 | | |
128 | 143 | | |
129 | | - | |
| 144 | + | |
130 | 145 | | |
131 | 146 | | |
132 | 147 | | |
| |||
142 | 157 | | |
143 | 158 | | |
144 | 159 | | |
145 | | - | |
| 160 | + | |
146 | 161 | | |
147 | 162 | | |
148 | 163 | | |
| |||
156 | 171 | | |
157 | 172 | | |
158 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
159 | 190 | | |
160 | 191 | | |
161 | 192 | | |
| |||
299 | 330 | | |
300 | 331 | | |
301 | 332 | | |
302 | | - | |
303 | | - | |
304 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
305 | 337 | | |
306 | 338 | | |
307 | 339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| |||
461 | 464 | | |
462 | 465 | | |
463 | 466 | | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
| 467 | + | |
490 | 468 | | |
491 | 469 | | |
492 | 470 | | |
| |||
527 | 505 | | |
528 | 506 | | |
529 | 507 | | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | 508 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| |||
225 | 228 | | |
226 | 229 | | |
227 | 230 | | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
| 231 | + | |
238 | 232 | | |
239 | 233 | | |
240 | 234 | | |
| |||
261 | 255 | | |
262 | 256 | | |
263 | 257 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | 258 | | |
268 | 259 | | |
269 | 260 | | |
| |||
316 | 307 | | |
317 | 308 | | |
318 | 309 | | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | 310 | | |
324 | 311 | | |
325 | 312 | | |
| |||
355 | 342 | | |
356 | 343 | | |
357 | 344 | | |
| 345 | + | |
| 346 | + | |
358 | 347 | | |
359 | 348 | | |
360 | 349 | | |
| |||
500 | 489 | | |
501 | 490 | | |
502 | 491 | | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
| 492 | + | |
523 | 493 | | |
524 | 494 | | |
525 | 495 | | |
| |||
533 | 503 | | |
534 | 504 | | |
535 | 505 | | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | 506 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
| |||
521 | 524 | | |
522 | 525 | | |
523 | 526 | | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
| 527 | + | |
553 | 528 | | |
554 | 529 | | |
555 | 530 | | |
| |||
647 | 622 | | |
648 | 623 | | |
649 | 624 | | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | 625 | | |
0 commit comments