mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-04 12:07:34 +00:00
chore: use empty SecretStr values as default
Better than using SecretStr | None so we centralize the null handling. Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
parent
c4cb6aa8d9
commit
4af141292f
51 changed files with 103 additions and 93 deletions
|
@ -6,13 +6,16 @@
|
|||
|
||||
from typing import Any
|
||||
|
||||
from pydantic import BaseModel, SecretStr
|
||||
from pydantic import BaseModel, Field, SecretStr
|
||||
|
||||
|
||||
class BingSearchToolConfig(BaseModel):
|
||||
"""Configuration for Bing Search Tool Runtime"""
|
||||
|
||||
api_key: SecretStr | None = None
|
||||
api_key: SecretStr = Field(
|
||||
default=SecretStr(""),
|
||||
description="The Bing API key",
|
||||
)
|
||||
top_k: int = 3
|
||||
|
||||
@classmethod
|
||||
|
|
|
@ -10,8 +10,8 @@ from pydantic import BaseModel, Field, SecretStr
|
|||
|
||||
|
||||
class BraveSearchToolConfig(BaseModel):
|
||||
api_key: SecretStr | None = Field(
|
||||
default=None,
|
||||
api_key: SecretStr = Field(
|
||||
default=SecretStr(""),
|
||||
description="The Brave Search API Key",
|
||||
)
|
||||
max_results: int = Field(
|
||||
|
|
|
@ -10,8 +10,8 @@ from pydantic import BaseModel, Field, SecretStr
|
|||
|
||||
|
||||
class TavilySearchToolConfig(BaseModel):
|
||||
api_key: SecretStr | None = Field(
|
||||
default=None,
|
||||
api_key: SecretStr = Field(
|
||||
default=SecretStr(""),
|
||||
description="The Tavily Search API Key",
|
||||
)
|
||||
max_results: int = Field(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue