From 2f2a85efc5683d45252a4a2944fcda6c8b693066 Mon Sep 17 00:00:00 2001 From: Harish Mohan Raj Date: Mon, 26 Aug 2024 18:45:17 +0530 Subject: [PATCH] Add title to the base url field (#79) --- fastagency/studio/models/llms/anthropic.py | 6 +++--- fastagency/studio/models/llms/azure.py | 2 +- fastagency/studio/models/llms/openai.py | 6 +++--- fastagency/studio/models/llms/together.py | 6 +++--- tests/studio/models/llms/test_anthropic.py | 2 +- tests/studio/models/llms/test_azure.py | 2 +- tests/studio/models/llms/test_openai.py | 2 +- tests/studio/models/llms/test_together.py | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/fastagency/studio/models/llms/anthropic.py b/fastagency/studio/models/llms/anthropic.py index 708b6fcc2..226889131 100644 --- a/fastagency/studio/models/llms/anthropic.py +++ b/fastagency/studio/models/llms/anthropic.py @@ -69,9 +69,9 @@ class Anthropic(Model): ), ] - base_url: Annotated[URL, Field(description="The base URL of the Anthropic API")] = ( - URL(url="https://api.anthropic.com/v1") - ) + base_url: Annotated[ + URL, Field(title="Base URL", description="The base URL of the Anthropic API") + ] = URL(url="https://api.anthropic.com/v1") api_type: Annotated[ Literal["anthropic"], diff --git a/fastagency/studio/models/llms/azure.py b/fastagency/studio/models/llms/azure.py index 5ebc461bf..3c2dddb16 100644 --- a/fastagency/studio/models/llms/azure.py +++ b/fastagency/studio/models/llms/azure.py @@ -67,7 +67,7 @@ class AzureOAI(Model): ] base_url: Annotated[ - URL, Field(description="The base URL of the Azure OpenAI API") + URL, Field(title="Base URL", description="The base URL of the Azure OpenAI API") ] = UrlModel(url="https://{your-resource-name}.openai.azure.com").url api_type: Annotated[ diff --git a/fastagency/studio/models/llms/openai.py b/fastagency/studio/models/llms/openai.py index 94f9e733b..83462078a 100644 --- a/fastagency/studio/models/llms/openai.py +++ b/fastagency/studio/models/llms/openai.py @@ -82,9 +82,9 @@ class OpenAI(Model): ), ] - base_url: Annotated[URL, Field(description="The base URL of the OpenAI API")] = URL( - url="https://api.openai.com/v1" - ) + base_url: Annotated[ + URL, Field(title="Base URL", description="The base URL of the OpenAI API") + ] = URL(url="https://api.openai.com/v1") api_type: Annotated[ Literal["openai"], diff --git a/fastagency/studio/models/llms/together.py b/fastagency/studio/models/llms/together.py index 602f9f466..ed90390d5 100644 --- a/fastagency/studio/models/llms/together.py +++ b/fastagency/studio/models/llms/together.py @@ -150,9 +150,9 @@ class TogetherAI(Model): Field(title="API Key", description="The API Key from Together.ai"), ] - base_url: Annotated[URL, Field(description="The base URL of the OpenAI API")] = URL( - url="https://api.together.xyz/v1" - ) + base_url: Annotated[ + URL, Field(title="Base URL", description="The base URL of the OpenAI API") + ] = URL(url="https://api.together.xyz/v1") api_type: Annotated[ Literal["togetherai"], diff --git a/tests/studio/models/llms/test_anthropic.py b/tests/studio/models/llms/test_anthropic.py index 796481f50..6e987db87 100644 --- a/tests/studio/models/llms/test_anthropic.py +++ b/tests/studio/models/llms/test_anthropic.py @@ -113,7 +113,7 @@ def test_anthropic_model_schema(self) -> None: "format": "uri", "maxLength": 2083, "minLength": 1, - "title": "Base Url", + "title": "Base URL", "type": "string", }, "api_type": { diff --git a/tests/studio/models/llms/test_azure.py b/tests/studio/models/llms/test_azure.py index c7f476d07..7adf9823f 100644 --- a/tests/studio/models/llms/test_azure.py +++ b/tests/studio/models/llms/test_azure.py @@ -138,7 +138,7 @@ def test_azure_model_schema(self) -> None: "format": "uri", "maxLength": 2083, "minLength": 1, - "title": "Base Url", + "title": "Base URL", "type": "string", }, "api_type": { diff --git a/tests/studio/models/llms/test_openai.py b/tests/studio/models/llms/test_openai.py index 2d824487f..007d75fb2 100644 --- a/tests/studio/models/llms/test_openai.py +++ b/tests/studio/models/llms/test_openai.py @@ -152,7 +152,7 @@ def test_openai_schema(self) -> None: "format": "uri", "maxLength": 2083, "minLength": 1, - "title": "Base Url", + "title": "Base URL", "type": "string", }, "api_type": { diff --git a/tests/studio/models/llms/test_together.py b/tests/studio/models/llms/test_together.py index d4ade1a1d..7aab8ebeb 100644 --- a/tests/studio/models/llms/test_together.py +++ b/tests/studio/models/llms/test_together.py @@ -143,7 +143,7 @@ def test_togetherai_schema(self) -> None: "format": "uri", "maxLength": 2083, "minLength": 1, - "title": "Base Url", + "title": "Base URL", "type": "string", }, "api_type": {