-
Notifications
You must be signed in to change notification settings - Fork 5
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
Updates for new OpenAI release post dev day #7
Conversation
transitive-bullshit
commented
Nov 7, 2023
•
edited
Loading
edited
- adds support for tools
- changes some other types required by openai updates
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
I'm not sure this is the best way to think about the relationship between the legacy functions and the new tools.
It seems like the legacy functions have the same structure and function, but are now nested under tools. I think all of the schema/spec/parser/implementation parts of AIFunction
should stay the same (without tools) and should be used by a new higher level tools abstraction that is just wraps a function for now, and presumably other things in the future.
Also, can you please start writing real commit messages :)
Sounds good & agreed. I haven't actually used
Yep; sorry about that. I try to use real git-flow commit messages for substantive stuff and |
This PR is now dependent on dexaai/openai-fetch#38 |
@rileytomasek I changed the tools and function I also fixed all the lingering TS issues, mainly due to the Not 100% sure I incorporated the |
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.
This looks good other than the name changes. Can we hold off removing the Message.name
stuff until everything settles from the new releases and it's clear what the status of name is? We're using it internally and I'd rather not change until we know it's definitely gone.
Edit: these changes are also going to require a major version bump, right?
choices: [ | ||
{ | ||
finish_reason: | ||
choice.finish_reason as Model.Chat.Response['choices'][0]['finish_reason'], | ||
index: choice.index, | ||
message: choice.delta as Model.Message, | ||
message: choice.delta as Model.Message & { role: 'assistant' }, |
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.
Do we need this now that you fixed the types for openai-fetch
?
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.
Good question && yes, unfortunately TS complains without it.
One thing I've noticed is that the new openai
types seem to have gotten a lot stricter in terms of inputs/outputs used in different places. I could be wrong since I've only just started getting back into things.
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.
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.
i think this is just from their jank types so we can leave as is for now
src/model/clients/openai.ts
Outdated
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.
Why this change? We are using this internally and I'd rather not change the existing code unless there is a reason 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.
hmmm was just a part of my removing name
, and I thought it made more sense to have a util to format the name
identifier directly than an object which at the time I was thinking would no longer have a name
property.
all good && will revert
Done.
Yes, though it's a brand new package, so we could just do a minor? I'm fine either way. |
Fixes #8 as well |
/** Message with text content for the system. */ | ||
export type System = { | ||
role: 'system'; | ||
name?: 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.
You missed these names when reverting
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.
ahhh good catch :) will revert
Everything looks good, except for the names I suggested 😂 What do you think of:
And then mirror to
|
I'm not opinionated when it comes to naming; the only problem I see w/ this is that It's the same issue w/ I don't have a strong feeling either way. |
If we call the tool calls 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.
🚢