Files
AutoGPT/benchmark/agbenchmark/schema.py
Krzysztof Czerwinski 7cb4d4a903 feat(forge, agent, benchmark): Upgrade to Pydantic v2 (#7280)
Update Pydantic dependency of `autogpt`, `forge` and `benchmark` to `^2.7`
[Pydantic Migration Guide](https://docs.pydantic.dev/2.7/migration/)

- Migrate usages of now-deprecated functions to their replacements
- Update `Field` definitions
  - Ellipsis `...` for required fields is deprecated
  - `Field` no longer supports extra `kwargs`, replace use of this feature with field metadata
- Replace `Config` class for specifying model configuration with `model_config = ConfigDict(..)`
- Removed `ModelContainer` in `BaseAgent`, component configuration dict is now directly serialized using Pydantic v2 helper functions
- Forked `agent-protocol` and updated `packages/client/python` for Pydantic v2 support: https://github.com/Significant-Gravitas/agent-protocol

---------

Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
2024-07-02 20:45:32 +02:00

19 lines
462 B
Python

from __future__ import annotations
from typing import Any, Optional
from pydantic import BaseModel, Field
class TaskRequestBody(BaseModel):
input: str = Field(
min_length=1,
description="Input prompt for the task.",
examples=["Write the words you receive to the file 'output.txt'."],
)
additional_input: Optional[dict[str, Any]] = Field(default_factory=dict)
class TaskEvalRequestBody(TaskRequestBody):
eval_id: str