mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-01-30 03:14:22 +01:00
Support agent protocol in benchmark (#5213)
Benchmark/Forge/Agent Protocol
This commit is contained in:
28
benchmark/agent_protocol_client/api_response.py
Normal file
28
benchmark/agent_protocol_client/api_response.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""API response object."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from pydantic import Field, StrictInt, StrictStr
|
||||
|
||||
|
||||
class ApiResponse:
|
||||
"""
|
||||
API response object
|
||||
"""
|
||||
|
||||
status_code: Optional[StrictInt] = Field(None, description="HTTP status code")
|
||||
headers: Optional[Dict[StrictStr, StrictStr]] = Field(
|
||||
None, description="HTTP headers"
|
||||
)
|
||||
data: Optional[Any] = Field(
|
||||
None, description="Deserialized data given the data type"
|
||||
)
|
||||
raw_data: Optional[Any] = Field(None, description="Raw data (HTTP response body)")
|
||||
|
||||
def __init__(self, status_code=None, headers=None, data=None, raw_data=None):
|
||||
self.status_code = status_code
|
||||
self.headers = headers
|
||||
self.data = data
|
||||
self.raw_data = raw_data
|
||||
Reference in New Issue
Block a user