chore: Updates model_config docstring to explicitly mentioning pydantic.

This is to disambiguate between pydantic model and LLM.

PiperOrigin-RevId: 754981617
This commit is contained in:
Wei Sun (Jack)
2025-05-05 10:12:09 -07:00
committed by Copybara-Service
parent a930633fad
commit dbea793cf5
15 changed files with 18 additions and 13 deletions

View File

@@ -14,11 +14,9 @@
from __future__ import annotations
from abc import abstractmethod
from typing import AsyncGenerator
from typing import TYPE_CHECKING
from typing import AsyncGenerator, TYPE_CHECKING
from google.genai import types
from pydantic import BaseModel
from pydantic import ConfigDict
@@ -34,14 +32,13 @@ class BaseLlm(BaseModel):
Attributes:
model: The name of the LLM, e.g. gemini-1.5-flash or gemini-1.5-flash-001.
model_config: The model config
"""
model_config = ConfigDict(
# This allows us to use arbitrary types in the model. E.g. PIL.Image.
arbitrary_types_allowed=True,
)
"""The model config."""
"""The pydantic model config."""
model: str
"""The name of the LLM, e.g. gemini-1.5-flash or gemini-1.5-flash-001."""

View File

@@ -573,7 +573,6 @@ class LiteLlm(BaseLlm):
Attributes:
model: The name of the LiteLlm model.
llm_client: The LLM client to use for the model.
model_config: The model config.
"""
llm_client: LiteLLMClient = Field(default_factory=LiteLLMClient)

View File

@@ -37,7 +37,7 @@ class LlmRequest(BaseModel):
"""
model_config = ConfigDict(arbitrary_types_allowed=True)
"""The model config."""
"""The pydantic model config."""
model: Optional[str] = None
"""The model name."""

View File

@@ -41,7 +41,7 @@ class LlmResponse(BaseModel):
"""
model_config = ConfigDict(extra='forbid')
"""The model config."""
"""The pydantic model config."""
content: Optional[types.Content] = None
"""The content of the response."""