feat - make anthropic async

This commit is contained in:
Ishaan Jaff 2024-04-06 15:50:13 -07:00
parent a2c63075ef
commit 58c4b02447
3 changed files with 231 additions and 140 deletions

View file

@ -304,6 +304,7 @@ async def acompletion(
or custom_llm_provider == "vertex_ai"
or custom_llm_provider == "gemini"
or custom_llm_provider == "sagemaker"
or custom_llm_provider == "anthropic"
or custom_llm_provider in litellm.openai_compatible_providers
): # currently implemented aiohttp calls for just azure, openai, hf, ollama, vertex ai soon all.
init_response = await loop.run_in_executor(None, func_with_context)
@ -1184,6 +1185,7 @@ def completion(
model=model,
messages=messages,
api_base=api_base,
acompletion=acompletion,
custom_prompt_dict=litellm.custom_prompt_dict,
model_response=model_response,
print_verbose=print_verbose,