mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-27 06:13:07 +00:00
This commit is contained in:
parent
5171b3fbd8
commit
2223895010
2 changed files with 3 additions and 1 deletions
|
|
@ -58,7 +58,7 @@ class CloudflareChatConfig(OpenAIGPTConfig):
|
|||
trimmed: Final = api_base.rstrip("/")
|
||||
if trimmed.endswith("/ai/run"):
|
||||
verbose_logger.warning(
|
||||
"Cloudflare api_base ending in '/ai/run' is the legacy Workers AI path and no longer serves OpenAI-compatible requests; rewriting to the '/ai/v1' endpoint"
|
||||
"Cloudflare chat completions require the OpenAI-compatible '/ai/v1' endpoint; rewriting api_base ending in '/ai/run' to '/ai/v1'. Decision models continue to use the native Workers AI '/ai/run/{model}' endpoint."
|
||||
)
|
||||
return join_api_base(trimmed[: -len("/ai/run")], "ai/v1")
|
||||
return api_base
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ class CloudflareDecisionsConfig(BaseDecisionsConfig):
|
|||
inlines_remote_images = True
|
||||
|
||||
def get_default_api_base(self) -> str | None:
|
||||
# Decision models (Clef) require native /ai/run/{model} requests with
|
||||
# state and questions; /ai/v1/chat/completions only accepts chat requests.
|
||||
return workers_ai_default_api_base()
|
||||
|
||||
def missing_api_base_message(self, custom_llm_provider: str) -> str:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue