Skip to content

Commit 1ae0f21

Browse files
committedApr 26, 2024··
refactor(client.go): remove modelTokens map and its usage to simplify Client configuration logic
1 parent d85cb3d commit 1ae0f21

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed
 

‎openai/client.go

-13
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,6 @@ const (
3636
DefaultChunkTimeout = 5 * time.Second
3737
)
3838

39-
var modelTokens = map[string]int{
40-
openai.GPT3Dot5Turbo: 4096,
41-
openai.GPT3Dot5Turbo16K: 16384,
42-
openai.GPT4: 8192,
43-
openai.GPT432K: 32768,
44-
"default": 4096,
45-
}
46-
4739
// Client is a configurable interface to the OpenAI API. It allows for the
4840
// generation of text completions using various models, with adjustable
4941
// parameters for token count, temperature, and topP. A specified timeout can be
@@ -172,11 +164,6 @@ func New(apiToken string, opts ...Option) *Client {
172164
c.model = DefaultModel
173165
}
174166

175-
var ok bool
176-
if c.maxTokens, ok = modelTokens[c.model]; !ok {
177-
c.maxTokens = modelTokens["default"]
178-
}
179-
180167
c.debug("Model: %s", c.model)
181168
c.debug("Temperature: %f", c.temperature)
182169
c.debug("TopP: %f", c.topP)

0 commit comments

Comments
 (0)
Please sign in to comment.