Don't add "accounts/fireworks/models" prefix for Fireworks Provider (#15938)

* init

* if not model.startswith("accounts/") and "#" not in model:
This commit is contained in:
1stprinciple 2025-10-31 04:36:42 +01:00 • committed by GitHub
parent 689b210c18
commit 2824388c30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View file

@ -1,10 +1,10 @@
import json
from litellm._uuid import uuid
from typing import Any, List, Literal, Optional, Tuple, Union, cast
import httpx
import litellm
from litellm._uuid import uuid
from litellm.constants import RESPONSE_FORMAT_TOOL_NAME
from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj
from litellm.litellm_core_utils.llm_response_utils.get_headers import (
@ -102,15 +102,15 @@ class FireworksAIConfig(OpenAIGPTConfig):
"prompt_truncate_length",
"context_length_exceeded_behavior",
]
# Only add tools for models that support function calling
if supports_function_calling(model=model, custom_llm_provider="fireworks_ai"):
supported_params.append("tools")
# Only add tool_choice for models that explicitly support it
if supports_tool_choice(model=model, custom_llm_provider="fireworks_ai"):
supported_params.append("tool_choice")
return supported_params
def map_openai_params(
@ -246,7 +246,7 @@ class FireworksAIConfig(OpenAIGPTConfig):
litellm_params: dict,
headers: dict,
) -> dict:
if not model.startswith("accounts/"):
if not model.startswith("accounts/") and "#" not in model:
model = f"accounts/fireworks/models/{model}"
messages = self._transform_messages_helper(
messages=messages, model=model, litellm_params=litellm_params

View file

@ -50,7 +50,7 @@ class FireworksAITextCompletionConfig(FireworksAIMixin, BaseTextCompletionConfig
) -> dict:
prompt = _transform_prompt(messages=messages)
if not model.startswith("accounts/"):
if not model.startswith("accounts/") and "#" not in model:
model = f"accounts/fireworks/models/{model}"
data = {