Skip to main content
SONZAI
Api

Personality

Batch-fetch agent personalities

POST
/agents/personalities/batch
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/agents/personalities/batch" \  -H "Content-Type: application/json" \  -d '{    "agent_ids": [      "string"    ]  }'
{
  "$schema": "/api/v1/schemas/BatchPersonalityResponse.json",
  "personalities": {
    "property1": {
      "evolution_count": 0,
      "profile": {
        "agent_id": "string",
        "avatar_url": "string",
        "behaviors": {
          "conflict_approach": "string",
          "empathy_style": "string",
          "question_frequency": "string",
          "response_length": "string"
        },
        "big5": {
          "agreeableness": {
            "confidence": 0.1,
            "facets": [
              "string"
            ],
            "level": "string",
            "score": 0.1
          },
          "conscientiousness": {
            "confidence": 0.1,
            "facets": [
              "string"
            ],
            "level": "string",
            "score": 0.1
          },
          "extraversion": {
            "confidence": 0.1,
            "facets": [
              "string"
            ],
            "level": "string",
            "score": 0.1
          },
          "neuroticism": {
            "confidence": 0.1,
            "facets": [
              "string"
            ],
            "level": "string",
            "score": 0.1
          },
          "openness": {
            "confidence": 0.1,
            "facets": [
              "string"
            ],
            "level": "string",
            "score": 0.1
          }
        },
        "bio": "string",
        "created_at": "string",
        "dimensions": {
          "aesthetic": 0.1,
          "assertiveness": 0.1,
          "compassion": 0.1,
          "enthusiasm": 0.1,
          "industriousness": 0.1,
          "intellect": 0.1,
          "orderliness": 0.1,
          "politeness": 0.1,
          "volatility": 0.1,
          "withdrawal": 0.1
        },
        "emotional_tendencies": {
          "property1": 0.1,
          "property2": 0.1
        },
        "gender": "string",
        "name": "string",
        "personality_prompt": "string",
        "preferences": {
          "conversation_pace": "string",
          "emotional_expression": "string",
          "formality": "string",
          "humor_style": "string"
        },
        "primary_traits": [
          "string"
        ],
        "speech_patterns": [
          "string"
        ],
        "temperature": 0.1,
        "trait_precisions": {
          "property1": {
            "last_updated_at": "2019-08-24T14:15:22Z",
            "observation_count": 0,
            "precision": 0.1
          },
          "property2": {
            "last_updated_at": "2019-08-24T14:15:22Z",
            "observation_count": 0,
            "precision": 0.1
          }
        },
        "true_dislikes": [
          "string"
        ],
        "true_interests": [
          "string"
        ]
      }
    },
    "property2": {
      "evolution_count": 0,
      "profile": {
        "agent_id": "string",
        "avatar_url": "string",
        "behaviors": {
          "conflict_approach": "string",
          "empathy_style": "string",
          "question_frequency": "string",
          "response_length": "string"
        },
        "big5": {
          "agreeableness": {
            "confidence": 0.1,
            "facets": [
              "string"
            ],
            "level": "string",
            "score": 0.1
          },
          "conscientiousness": {
            "confidence": 0.1,
            "facets": [
              "string"
            ],
            "level": "string",
            "score": 0.1
          },
          "extraversion": {
            "confidence": 0.1,
            "facets": [
              "string"
            ],
            "level": "string",
            "score": 0.1
          },
          "neuroticism": {
            "confidence": 0.1,
            "facets": [
              "string"
            ],
            "level": "string",
            "score": 0.1
          },
          "openness": {
            "confidence": 0.1,
            "facets": [
              "string"
            ],
            "level": "string",
            "score": 0.1
          }
        },
        "bio": "string",
        "created_at": "string",
        "dimensions": {
          "aesthetic": 0.1,
          "assertiveness": 0.1,
          "compassion": 0.1,
          "enthusiasm": 0.1,
          "industriousness": 0.1,
          "intellect": 0.1,
          "orderliness": 0.1,
          "politeness": 0.1,
          "volatility": 0.1,
          "withdrawal": 0.1
        },
        "emotional_tendencies": {
          "property1": 0.1,
          "property2": 0.1
        },
        "gender": "string",
        "name": "string",
        "personality_prompt": "string",
        "preferences": {
          "conversation_pace": "string",
          "emotional_expression": "string",
          "formality": "string",
          "humor_style": "string"
        },
        "primary_traits": [
          "string"
        ],
        "speech_patterns": [
          "string"
        ],
        "temperature": 0.1,
        "trait_precisions": {
          "property1": {
            "last_updated_at": "2019-08-24T14:15:22Z",
            "observation_count": 0,
            "precision": 0.1
          },
          "property2": {
            "last_updated_at": "2019-08-24T14:15:22Z",
            "observation_count": 0,
            "precision": 0.1
          }
        },
        "true_dislikes": [
          "string"
        ],
        "true_interests": [
          "string"
        ]
      }
    }
  }
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Get agent personality profile and evolution

GET
/agents/{agentId}/personality
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

agentId*string

Agent UUID or URL-encoded agent name

Query Parameters

history_limit?integer

Max evolution entries to return (1-1000)

Default200
Formatint64
since?string

Start date for evolution history (YYYY-MM-DD)

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/agents/string/personality"
{
  "$schema": "/api/v1/schemas/PersonalityResponse.json",
  "evolution": [
    {
      "applied_delta": 0.1,
      "confidence": 0.1,
      "dampening_factor": 0.1,
      "delta": 0.1,
      "is_significant_moment": true,
      "new_value": 0.1,
      "old_value": 0.1,
      "posterior_precision": 0.1,
      "prediction_error": 0.1,
      "prior_precision": 0.1,
      "proposed_delta": 0.1,
      "reasoning": "string",
      "timestamp": "2019-08-24T14:15:22Z",
      "trait_category": "string",
      "trait_name": "string",
      "trigger_type": "string",
      "user_id": "string"
    }
  ],
  "profile": {
    "agent_id": "string",
    "avatar_url": "string",
    "behaviors": {
      "conflict_approach": "string",
      "empathy_style": "string",
      "question_frequency": "string",
      "response_length": "string"
    },
    "big5": {
      "agreeableness": {
        "confidence": 0.1,
        "facets": [
          "string"
        ],
        "level": "string",
        "score": 0.1
      },
      "conscientiousness": {
        "confidence": 0.1,
        "facets": [
          "string"
        ],
        "level": "string",
        "score": 0.1
      },
      "extraversion": {
        "confidence": 0.1,
        "facets": [
          "string"
        ],
        "level": "string",
        "score": 0.1
      },
      "neuroticism": {
        "confidence": 0.1,
        "facets": [
          "string"
        ],
        "level": "string",
        "score": 0.1
      },
      "openness": {
        "confidence": 0.1,
        "facets": [
          "string"
        ],
        "level": "string",
        "score": 0.1
      }
    },
    "bio": "string",
    "created_at": "string",
    "dimensions": {
      "aesthetic": 0.1,
      "assertiveness": 0.1,
      "compassion": 0.1,
      "enthusiasm": 0.1,
      "industriousness": 0.1,
      "intellect": 0.1,
      "orderliness": 0.1,
      "politeness": 0.1,
      "volatility": 0.1,
      "withdrawal": 0.1
    },
    "emotional_tendencies": {
      "property1": 0.1,
      "property2": 0.1
    },
    "gender": "string",
    "name": "string",
    "personality_prompt": "string",
    "preferences": {
      "conversation_pace": "string",
      "emotional_expression": "string",
      "formality": "string",
      "humor_style": "string"
    },
    "primary_traits": [
      "string"
    ],
    "speech_patterns": [
      "string"
    ],
    "temperature": 0.1,
    "trait_precisions": {
      "property1": {
        "last_updated_at": "2019-08-24T14:15:22Z",
        "observation_count": 0,
        "precision": 0.1
      },
      "property2": {
        "last_updated_at": "2019-08-24T14:15:22Z",
        "observation_count": 0,
        "precision": 0.1
      }
    },
    "true_dislikes": [
      "string"
    ],
    "true_interests": [
      "string"
    ]
  }
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Update agent personality scores

PUT
/agents/{agentId}/personality
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

agentId*string

Agent UUID or URL-encoded agent name

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X PUT "https://loading/api/v1/agents/string/personality" \  -H "Content-Type: application/json" \  -d '{}'
{
  "$schema": "/api/v1/schemas/UpdatePersonalityOutputBody.json",
  "success": true
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}