I did some changes: refactoring, bugfixing, logging and tracking costs and usage#2
Merged
gdorsi44 merged 2 commits intoFeb 17, 2024
Conversation
- Now it waits till the client finishes work - It tracks the program with System.out.println instructions explaining what is happening in crucial moments - I put all urls in properties so that they are in one place and easily accessible to make sure all of them are legit and there is no shady stuff going on in this project - I also put user prompt and assistant instructions in properties for easy customization - I changed default model to gpt-3.5-turbo because it is 15x cheaper, and the user will most likely do some test runs at first, so its gonna save him a lot of money - I made it simple to revert to gpt-4 model and put its name in GPTModel enum, also added a comment about the current pricing and limitations - Also some minor adjustments like removing some unnecessary comment and adjusting variable names to make the code more understandable - I added println that will show you all the responses so that you see what you are billed for Not the nicest code I ever written but its decent and gets the job done. I have massive concerns with Assistant API from OpenAI, not sure if I want to contribute and use it. Basically, a single and simple instruction and message that should be answered with a few words might result in tens of responses and there is no way to control that. Will report these concerns as Issue.
Assistant API might get very expensive in case of any issue during processing the prompt, therefore I added appropriate section in README.md. These issues forced me to stop of using Assistant API, and I think users should be aware of risks associated with using Assistant API.
gdorsi44
approved these changes
Feb 17, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have some big concerns about Assistant API frop OpenAI, I created an issue. Please review them.