Skip to content

Commit 9e45a5b

Browse files
committed
upgrade tiktoken to support gpt-5, fixed temperature 1.0 for gpt-5
1 parent c0f8b44 commit 9e45a5b

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"dependencies": {
7373
"@aws-sdk/client-s3": "^3.864.0",
7474
"@azure/openai": "^1.0.0-beta.11",
75-
"@dqbd/tiktoken": "^1.0.16",
75+
"@dqbd/tiktoken": "^1.0.22",
7676
"@emotion/react": "^11.14.0",
7777
"@emotion/styled": "^11.14.0",
7878
"@langchain/community": "^0.3.50",

src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export const validModels = [
3535
{
3636
name: 'gpt-5',
3737
context: 128_000,
38+
temperature: 1.0,
3839
},
3940
{
4041
name: 'mock',

src/server/services/langchain/chat.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ const getChatModel = (model: string, tools: StructuredTool[], temperature: numbe
3131
azureOpenAIApiVersion: '2023-05-15',
3232
azureOpenAIApiDeploymentName: model, // In Azure, always use the acual model name as the deployment name
3333
azureOpenAIApiInstanceName: AZURE_RESOURCE,
34-
temperature,
34+
temperature: modelConfig.temperature ?? temperature, // If model config specifies a temperature, use it; otherwise, use the user supplied temperature.
35+
reasoning: {
36+
effort: 'minimal',
37+
summary: null,
38+
generate_summary: null,
39+
},
3540
}).bindTools(tools)
3641

3742
return chatModel

0 commit comments

Comments
 (0)