mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
(feat) cloudflare ai workers - add completion support
This commit is contained in:
parent
6f2734100f
commit
8fcfb7df22
2 changed files with 26 additions and 35 deletions
|
@ -1572,12 +1572,14 @@ def completion(
|
|||
or litellm.api_key
|
||||
or get_secret("CLOUDFLARE_API_KEY")
|
||||
)
|
||||
# api_base = (
|
||||
# api_base
|
||||
# or litellm.api_base
|
||||
# or get_secret("CLOUDFLARE_API_BASE")
|
||||
# or "https://api.anthropic.com/v1/complete"
|
||||
# )
|
||||
account_id = get_secret("CLOUDFLARE_ACCOUNT_ID")
|
||||
api_base = (
|
||||
api_base
|
||||
or litellm.api_base
|
||||
or get_secret("CLOUDFLARE_API_BASE")
|
||||
or f"https://api.cloudflare.com/client/v4/accounts/{account_id}/ai/run/"
|
||||
)
|
||||
|
||||
custom_prompt_dict = custom_prompt_dict or litellm.custom_prompt_dict
|
||||
response = cloudflare.completion(
|
||||
model=model,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue