You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Dockerized:** The output is a single docker image that you can deploy anywhere.
28
28
-**Easy to Use:** AgentServe provides a CLI tool to initialize and setup your AI agent projects.
29
+
-**Schema Validation:** Define input schemas for your agents using AgentInput to ensure data consistency and validation.
29
30
30
31
## Requirements
31
32
@@ -161,6 +162,86 @@ Get the result of a task.
161
162
162
163
-`result`: The result of the task.
163
164
165
+
## Defining Input Schemas
166
+
167
+
AgentServe uses AgentInput (an alias for Pydantic's BaseModel) to define and validate the input schemas for your agents. This ensures that the data received by your agents adheres to the expected structure, enhancing reliability and developer experience.
168
+
### Subclassing AgentInput
169
+
To define a custom input schema for your agent, subclass AgentInput and specify the required fields.
When creating your agent, assign your custom schema to the input_schema attribute. This ensures that all incoming task_data is validated against your defined schema before processing.
AgentServe will automatically validate incoming task_data against the defined input_schema. If the data does not conform to the schema, a 400 Bad Request error will be returned with details about the validation failure.
228
+
229
+
**Example Response:**
230
+
231
+
```json
232
+
{
233
+
"detail": [
234
+
{
235
+
"loc": ["body", "prompt"],
236
+
"msg": "field required",
237
+
"type": "value_error.missing"
238
+
}
239
+
]
240
+
}
241
+
```
242
+
243
+
Ensure that your clients provide data that matches the schema to avoid validation errors.
0 commit comments