-
Notifications
You must be signed in to change notification settings - Fork 2
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 SpiceClient #2
Conversation
else: | ||
response = chat_completion_or_stream.choices[0].message.content | ||
return response | ||
raise ValueError(f"Unknown model {model}") |
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.
Consider adding support for more models or a default model to avoid raising an exception for unknown models. This would make the client more flexible.
spice.py
Outdated
|
||
load_dotenv() |
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 a good practice to call load_dotenv()
at the entry point of the application to ensure environment variables are loaded once and available throughout the application. Consider moving this call outside of the class.
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 call
spice.py
Outdated
else: | ||
content = chunk.choices[0].delta.content | ||
if content is not None: | ||
yield 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.
The check for content is not None
might be redundant since you're initializing content
to an empty string and only changing it if certain conditions are met. Consider removing this check.
MENTAT CODE REVIEW IN ACTIVE DEVELOPMENT. Only in use on mentat and internal repos. Overall, the implementation of the |
Co-authored-by: abanteai-butler[bot] <160964065+abanteai-butler[bot]@users.noreply.github.com>
No description provided.