File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ const (
29
29
// option when creating a new client.
30
30
DefaultTimeout = 3 * time .Minute
31
31
32
+ // DefaultChunkTimeout specifies the default duration for waiting on a chunk of
33
+ // data during streaming operations before timing out. This value can be
34
+ // adjusted to control how long the system will wait for a chunk before
35
+ // considering the operation timed out.
32
36
DefaultChunkTimeout = 5 * time .Second
33
37
)
34
38
@@ -85,6 +89,9 @@ func ResponseFormat[Format string | openai.ChatCompletionResponseFormatType](for
85
89
}
86
90
}
87
91
92
+ // MaxTokens configures the maximum number of tokens that the Client can use for
93
+ // generating text completions. It accepts an integer value and returns an
94
+ // [Option] to modify a [Client] instance.
88
95
func MaxTokens (maxTokens int ) Option {
89
96
return func (m * Client ) {
90
97
m .maxTokens = maxTokens
@@ -106,6 +113,9 @@ func TopP(topP float32) Option {
106
113
}
107
114
}
108
115
116
+ // ChunkTimeout sets the maximum duration a Client should wait for a chunk of
117
+ // data during streaming operations before timing out. This is configured as an
118
+ // Option that modifies the chunkTimeout field of a Client instance.
109
119
func ChunkTimeout (timeout time.Duration ) Option {
110
120
return func (m * Client ) {
111
121
m .chunkTimeout = timeout
You can’t perform that action at this time.
0 commit comments