Skip to content

Commit 9c6b9f2

Browse files
authored
Add reasoning models O1 and O4-mini (#154)
It seems that the reasoning models don't support tools (functions in OpenAI lingo) with optional parameters. We only had two tools that were using optional parameters, and we didn't really need that, so for now I just made the parameters mandatory. This just adds the models, but we'd want the UI to display the intermediary reasoning as well, which is not happening currently.
1 parent d1100dd commit 9c6b9f2

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

apps/dbagent/src/lib/ai/providers/builtin.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ const builtinOpenAIModels: BuiltinProvider = {
4242
id: 'openai:gpt-4-turbo',
4343
providerId: 'gpt-4-turbo',
4444
name: 'GPT-4 Turbo'
45+
},
46+
{
47+
id: 'openai:o4-mini',
48+
providerId: 'o4-mini',
49+
name: 'OpenAI o4-mini'
50+
},
51+
{
52+
id: 'openai:o1',
53+
providerId: 'o1',
54+
name: 'OpenAI o1'
4555
}
4656
]
4757
};

apps/dbagent/src/lib/ai/tools/cluster.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@ export class AWSDBClusterTools implements ToolsetGroup {
8888
const getter = this.#getter;
8989
const db = this.#dbAccess;
9090
return tool({
91-
description: `Get the recent logs from the RDS instance. You can specify the period in seconds and optionally grep for a substring.`,
91+
description: `Get the recent logs from the RDS instance. You can specify the period in seconds and optionally grep for a substring.
92+
If you don't want to grep for a substring, you can pass an empty string.`,
9293
parameters: z.object({
9394
periodInSeconds: z.number(),
94-
grep: z.string().optional()
95+
grep: z.string()
9596
}),
9697
execute: async ({ periodInSeconds, grep }) => {
9798
console.log('getInstanceLogs', periodInSeconds, grep);
@@ -106,11 +107,11 @@ export class AWSDBClusterTools implements ToolsetGroup {
106107
const db = this.#dbAccess;
107108
return tool({
108109
description: `Get the metrics for the RDS instance. If this is a cluster, the metric is read from the current writer instance.
109-
You can specify the period in seconds. The stat parameter is one of the following: Average, Maximum, Minimum, Sum. It defaults to Average.`,
110+
You can specify the period in seconds. The stat parameter is one of the following: Average, Maximum, Minimum, Sum.`,
110111
parameters: z.object({
111112
metricName: z.string(),
112113
periodInSeconds: z.number(),
113-
stat: z.enum(['Average', 'Maximum', 'Minimum', 'Sum']).optional()
114+
stat: z.enum(['Average', 'Maximum', 'Minimum', 'Sum'])
114115
}),
115116
execute: async ({ metricName, periodInSeconds, stat }) => {
116117
console.log('getClusterMetric', metricName, periodInSeconds);

0 commit comments

Comments
 (0)