Mirascope / mirascope

LLM abstractions that aren't obstructions
http://mirascope.com/
MIT License
757 stars 49 forks source link

Improve error message when using custom client for sync vs. async cases #519

Closed willbakst closed 2 weeks ago

willbakst commented 1 month ago

Description

The error message when using the incorrect client with sync vs. async calls is currently unhelpful. See #513

We should add better error messages that throw a ValueError in the event that the function is sync and using an async client and vice versa.

For example, for OpenAI this would happen as an else block check here

We should add this for all providers.

willbakst commented 1 month ago

Changes from #607 make this better through type/lint errors, but I still think a value error would be useful here.

willbakst commented 2 weeks ago

Upon further thought, I think the type/lint errors are sufficient here, and adding additional value errors would be unnecessary overhead for no additional value, so I'm closing this issue.