-
Notifications
You must be signed in to change notification settings - Fork 13
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
Gpt 4o mini #92
base: staging
Are you sure you want to change the base?
Gpt 4o mini #92
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
jest.config.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.
Let's remove the unused comments in this file
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.
its autogenerated by jest initialization. They are config options with description of what they do, it looks it will be helpful for any future changes
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.
We can always get them from the docs. No need keeping them if we aren't using it
|
||
on: | ||
pull_request: | ||
branches: [main] |
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.
shouldn't we test on staging as well?
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 gh-action runs the external-dependencies tests directory.
The external dependencies test directory should be limited to only PR to main because we call openai chat completion in there and that has a cost/million token.
I'm looking at this directory to hold tests that requires API calls or dependencies you wouldn't want running too often, and on PR to main seems like a good approach
93b6351
to
2236327
Compare
This PR implements the groundwork for unit testing
Adds
extractor.test.ts
Ensures the gpt extractor output adheres to some predefined structure. I included some mock data (mocking different chat history context) and the tests do infact make calls to openAI against this mock data. (useful if we change models or prompt, so we have an objective test)
apiMessageSeparator.test.ts
This tests for the function that separates the output into the 3 components. (body, follow-up questions, and links).
This is a unit functional test that should be part of our CI/CD.
A consequence of these tests is that they make our prompts better and outputs relatively deterministic (at least for the extractor). For example, usually for every model change we edit the prompts for that particular model, using the extractor test we have a objective measurement that informs us if the prompt works, and consequently makes the prompts robust as switching between models and running the tests can highlight vague instructions in the prompts.
note: as at the time of writing, all mainstream models used as
OPENAI_EXTRACTOR_MODEL
passes the extractor test