Skip to content

Commit

Permalink
refactor(g4f/client/__init__.py): Improve provider handling in async_…
Browse files Browse the repository at this point in the history
…generate method
  • Loading branch information
kqlio67 committed Nov 19, 2024
1 parent 60f7f5d commit 6ff94bc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions g4f/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ async def async_generate(self, prompt: str, model: str = None, provider: Provide
provider_handler = self.models.get(model, provider or self.provider or BingCreateImages)
elif isinstance(provider, str):
provider_handler = convert_to_provider(provider)
else:
provider_handler = provider
if provider_handler is None:
raise ValueError(f"Unknown model: {model}")
if proxy is None:
Expand Down

0 comments on commit 6ff94bc

Please sign in to comment.