chore: Remove redundant attribute descriptions from docstrings

The attributes are already defined as fields in the Pydantic models, making the docstring descriptions unnecessary.

PiperOrigin-RevId: 806091305
This commit is contained in:
Hangfei Lin
2025-09-11 20:15:19 -07:00
committed by Copybara-Service
parent 9862b7b1e2
commit f73ae6e101
3 changed files with 6 additions and 28 deletions
+1 -12
View File
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import annotations
from datetime import datetime
@@ -31,18 +32,6 @@ class Event(LlmResponse):
It is used to store the content of the conversation, as well as the actions
taken by the agents like function calls, etc.
Attributes:
invocation_id: Required. The invocation ID of the event. Should be non-empty
before appending to a session.
author: Required. "user" or the name of the agent, indicating who appended
the event to the session.
actions: The actions taken by the agent.
long_running_tool_ids: The ids of the long running function calls.
branch: The branch of the event.
id: The unique identifier of the event.
timestamp: The timestamp of the event.
get_function_calls: Returns the function calls in the event.
"""
model_config = ConfigDict(
+2 -5
View File
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import annotations
from abc import abstractmethod
@@ -29,11 +30,7 @@ if TYPE_CHECKING:
class BaseLlm(BaseModel):
"""The BaseLLM class.
Attributes:
model: The name of the LLM, e.g. gemini-2.5-flash or gemini-2.5-pro.
"""
"""The BaseLLM class."""
model_config = ConfigDict(
# This allows us to use arbitrary types in the model. E.g. PIL.Image.
+3 -11
View File
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import annotations
from typing import Any
from pydantic import alias_generators
@@ -23,17 +25,7 @@ from ..events.event import Event
class Session(BaseModel):
"""Represents a series of interactions between a user and agents.
Attributes:
id: The unique identifier of the session.
app_name: The name of the app.
user_id: The id of the user.
state: The state of the session.
events: The events of the session, e.g. user input, model response, function
call/response, etc.
last_update_time: The last update time of the session.
"""
"""Represents a series of interactions between a user and agents."""
model_config = ConfigDict(
extra='forbid',