fix: patch openai byok (#3966)
This commit is contained in:
@@ -42,6 +42,7 @@ from letta.utils import get_tool_call_id, smart_urljoin
|
||||
logger = get_logger(__name__)
|
||||
|
||||
|
||||
# TODO: MOVE THIS TO OPENAI_CLIENT
|
||||
def openai_check_valid_api_key(base_url: str, api_key: Union[str, None]) -> None:
|
||||
if api_key:
|
||||
try:
|
||||
|
||||
@@ -20,10 +20,10 @@ class OpenAIProvider(Provider):
|
||||
provider_type: Literal[ProviderType.openai] = Field(ProviderType.openai, description="The type of the provider.")
|
||||
provider_category: ProviderCategory = Field(ProviderCategory.base, description="The category of the provider (base or byok)")
|
||||
api_key: str = Field(..., description="API key for the OpenAI API.")
|
||||
base_url: str = Field(..., description="Base URL for the OpenAI API.")
|
||||
base_url: str = Field("https://api.openai.com/v1", description="Base URL for the OpenAI API.")
|
||||
|
||||
async def check_api_key(self):
|
||||
from letta.llm_api.openai import openai_check_valid_api_key
|
||||
from letta.llm_api.openai import openai_check_valid_api_key # TODO: DO NOT USE THIS - old code path
|
||||
|
||||
openai_check_valid_api_key(self.base_url, self.api_key)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user