-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Vercel AI and Gemini Flash #22
Conversation
info.message = stripAnsi(info.message); | ||
return info; | ||
const testPlanSchema = z.object({ | ||
arrayOfSpecs: z.array(z.string()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GPT-4o will only accept JSON/zod schemas where the base type is an object. I originally tried const testPlanSchema = z.array(z.string());
and it threw an error saying that. So this object shape ensures cross-compatability.
winston.format.printf( | ||
({ timestamp, level, message }) => | ||
`${timestamp} [${level.toUpperCase()}] - ${message}`, | ||
`${timestamp} [${level.toUpperCase()}] - ${stripAnsi(message)}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ansi stripping didn't need to be so complicated and there were typeissues with the previous way the object was being handled for some reason
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a few minor notes.
|
||
const actionStepSchema = z.object({ | ||
planningThoughtAboutTheActionIWillTake: z.string(), | ||
action: z.object({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you make the action type a discriminate union? That way you could have stricter types for each action type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, let me open an issue for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
logger.info(output.choices[0].message.content); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't we still need some rate-limiting retry mechanism? Or does vercels sdk have this baked in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I went this way because I saw it baked in with a expoential backoff apparently:
https://sdk.vercel.ai/docs/ai-sdk-core/settings#maxretries
Want to give it a try and see if we need to bump the maxRetires above the default of 2?
}, | ||
"dependencies": { | ||
"@ai-sdk/anthropic": "^0.0.19", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: doesn't look like anthropic is actually used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's wired up in the model config for claude-3-haiku! Haven't tested it yet but will soon
No idea which base models performs best yet, but GPT-4o was expensive to run hundreds or thousands of times in development, so this PR swaps the OpenAI sdk for the Vercel AI sdk which supports many (cheaper) models addressing #20
Again, not a performance review, but:
I tested briefly with Gemini Flash and found it vaguely capable enough to use in development runs, and crucially it is currently free up to the following limits:
That makes a big difference in cost while developing.
Example trajectory output below: