Commit 8ee1e8b
committed
feat: make MaxRetries configurable in OpenAI provider (#115)
Add MaxRetries *int to config.OpenAI. When set, option.WithMaxRetries is
passed to the SDK client in both responses and chat completions interceptors.
Nil preserves the SDK default (2 retries); 0 disables retries entirely.
Update TestClientAndConnectionError and TestUpstreamError to set
MaxRetries=0, eliminating retry delays and speeding up these tests.1 parent 1d53ad0 commit 8ee1e8b
4 files changed
Lines changed: 20 additions & 8 deletions
File tree
- config
- intercept
- chatcompletions
- responses
- internal/integrationtest
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | 599 | | |
603 | 600 | | |
604 | 601 | | |
| |||
642 | 639 | | |
643 | 640 | | |
644 | 641 | | |
645 | | - | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
646 | 647 | | |
647 | 648 | | |
648 | 649 | | |
| |||
660 | 661 | | |
661 | 662 | | |
662 | 663 | | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | 664 | | |
667 | 665 | | |
668 | 666 | | |
| |||
721 | 719 | | |
722 | 720 | | |
723 | 721 | | |
724 | | - | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
725 | 727 | | |
726 | 728 | | |
727 | 729 | | |
| |||
0 commit comments