-
Notifications
You must be signed in to change notification settings - Fork 627
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
Minor improvement to whichapi & anthropic configuration #42
Conversation
Makes whichApi an enum for less error prone configuration
relate: when #41 merged i will improve the configuration in this pr okxiaoliang4#1 |
We shouldn't have Please make these all default the empty string, and parse values where they're used. |
Yeah that's fair, but if I was to parse the values like below should we have a fallback or alert the user in some manner?
Also maxTokens is a number, would you suggest converting that to string or keeping as a number with
|
To keep everything consistent, I suggest making everything a string. Let’s parseInt() when we need an int. I think we should just raise an error in the “negative” case. This makes it much clearer what’s going on in the case of an unexpected value. Also, I’m pretty sure the negative case of whichApi can never be reached anyway - package.json says the value is an enum. |
I've rejigged this from your suggestions @andrewpareles |
I made a typo when configuring my
whichApi
value🙄Hopefully, this PR prevents others doing the same by forcing the values to be selectable from an enum.
Whilst in here, I made the
max_tokens
andmodel
values foranthropic
a configurable value.I'm happy to implement similar approach on the others configs and refactor the configuration a little but I didn't want to jump in without running by the void owners. I would also suggest waiting until PR #22 is implemented as that introduces some new configuration values for Ollama integration and don't want to raise a bunch of conflicts