agentsociety.webapi.api.agent_profiles

Module Contents

Classes

SaveProfileRequest

Request model for saving agent profiles

Functions

list_agent_profiles

List all agent profiles for the current tenant

get_agent_profile

Get agent profile data by profile ID

delete_agent_profile

Delete a saved agent profile

validate_and_process_ids

Validate and process ID fields in the data. Handles three cases:

upload_agent_profile

Upload an agent profile file and save it to the database.

Data

API

agentsociety.webapi.api.agent_profiles.__all__

[‘router’]

agentsociety.webapi.api.agent_profiles.router

‘APIRouter(…)’

class agentsociety.webapi.api.agent_profiles.SaveProfileRequest

Bases: pydantic.BaseModel

Request model for saving agent profiles

name: str

‘Field(…)’

description: Optional[str]

‘Field(…)’

agent_type: str

‘Field(…)’

file_path: str

‘Field(…)’

async agentsociety.webapi.api.agent_profiles.list_agent_profiles(request: fastapi.Request) agentsociety.webapi.models.ApiResponseWrapper[List[agentsociety.webapi.models.agent_profiles.ApiAgentProfile]]

List all agent profiles for the current tenant

async agentsociety.webapi.api.agent_profiles.get_agent_profile(request: fastapi.Request, profile_id: uuid.UUID) agentsociety.webapi.models.ApiResponseWrapper[List[Dict[str, Any]]]

Get agent profile data by profile ID

async agentsociety.webapi.api.agent_profiles.delete_agent_profile(request: fastapi.Request, profile_id: uuid.UUID) agentsociety.webapi.models.ApiResponseWrapper[Dict[str, str]]

Delete a saved agent profile

agentsociety.webapi.api.agent_profiles.validate_and_process_ids(data: List[Dict[str, Any]]) List[Dict[str, Any]]

Validate and process ID fields in the data. Handles three cases:

  1. All records have IDs

  2. No records have IDs

  3. Some records have IDs while others don’t

Args: data: List of dictionaries containing agent profile data

Returns: List of dictionaries with validated and processed IDs

Raises: HTTPException: If invalid or duplicate IDs are found

async agentsociety.webapi.api.agent_profiles.upload_agent_profile(request: fastapi.Request, file: fastapi.UploadFile = File(...), name: Optional[str] = Form(None), description: Optional[str] = Form(None)) agentsociety.webapi.models.ApiResponseWrapper[agentsociety.webapi.models.agent_profiles.ApiAgentProfile]

Upload an agent profile file and save it to the database.