AbanteAI / mentat

Mentat - The AI Coding Assistant
https://mentat.ai
Apache License 2.0
2.42k stars 226 forks source link

add provider checking based on model name and provider #571

Closed PCSwingle closed 2 months ago

mentatbot[bot] commented 2 months ago

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 commented 2 months ago

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?

jakethekoenig commented 2 months ago

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 commented 2 months ago

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