Skip to content
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 provider checking based on model name and provider #571

Merged
merged 6 commits into from
Apr 22, 2024

Conversation

PCSwingle
Copy link
Member

No description provided.

mentat/code_context.py Outdated Show resolved Hide resolved
mentat/llm_api_handler.py Outdated Show resolved Hide resolved
Copy link
Contributor

mentatbot bot commented Apr 18, 2024

MENTAT CODE REVIEW IN ACTIVE DEVELOPMENT. Only in use on mentat and internal repos.
Please Reply with feedback.

This pull request introduces important updates to handle provider checking based on model names and providers dynamically. The changes are well thought out, particularly in handling different providers and ensuring that the API calls are guarded against common errors. However, there are a few areas where the implementation could be improved for clarity, error handling, and user guidance. Addressing these points will make the code more robust and user-friendly.

@jakethekoenig
Copy link
Member

When I set my model to test I get an exception without an opportunity to set my provider:
image
Maybe we should wrap count_tokens to return 0 if it would throw an exception?

Copy link
Member

@jakethekoenig jakethekoenig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I set my model to "test" and my provider to "openai" or "open_ai" I get the same exception
image

mentat/llm_api_handler.py Outdated Show resolved Hide resolved
mentat/llm_api_handler.py Show resolved Hide resolved
@jakethekoenig
Copy link
Member

This might not be totally connected to this PR but it would be nice if mentat didn't disable the user input box if they get a 404 from the api. For instance if I set my model to test I get the following (reasonable) error but then I can't enter anything into the box again
image

@PCSwingle
Copy link
Member Author

This might not be totally connected to this PR but it would be nice if mentat didn't disable the user input box if they get a 404 from the api.

Agreed but it might be better to do in a separate PR

Copy link
Member

@jakethekoenig jakethekoenig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I guess another thing to do in another PR is upgrade to 0.2 spice

@PCSwingle PCSwingle merged commit 03cc739 into main Apr 22, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants