Files
Auto-GPT/benchmark/agbenchmark/agent_protocol_client/api_response.py
merwanehamadi ece9e85b41 Add agent protocol within agbenchmark (#5239)
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
2023-09-16 15:31:12 -07:00

29 lines
807 B
Python

"""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