Documentation Components

Enhanced components for creating beautiful and functional documentation with syntax highlighting, interactive examples, and rich callouts.

Component Reference

These components are used throughout the AIPersona documentation. You can reference this page when building your own documentation or integrations.

Code Blocks

Single Language Example

Creating a Personapersona.js
JavaScript
1// Create a new persona via tRPC
2const response = await fetch('https://aipersona.dsethiopia.org/api/trpc/persona.create', {
3  method: 'POST',
4  headers: {
5    'Content-Type': 'application/json',
6    'X-API-Key': process.env.AIPERSONA_API_KEY,
7    'X-Organization-ID': process.env.AIPERSONA_ORG_ID,
8  },
9  body: JSON.stringify({
10    json: {
11      name: 'Customer Support Agent',
12      description: 'A helpful customer support specialist',
13      type: 'ASSISTANT',
14      systemPrompt: 'You are a helpful customer support agent...',
15    temperature: 0.7,
16      maxTokens: 2000,
17      model: 'gpt-4'
18    }
19  })
20});
21
22const result = await response.json();
23console.log('Created persona:', result.result.data);

Multi-Language Tabs

create-persona.js
JavaScript
// Create a new persona via tRPC
const response = await fetch('https://aipersona.dsethiopia.org/api/trpc/persona.create', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': process.env.AIPERSONA_API_KEY,
    'X-Organization-ID': process.env.AIPERSONA_ORG_ID,
  },
  body: JSON.stringify({
    json: {
      name: 'Customer Support Agent',
      description: 'A helpful customer support specialist',
      type: 'ASSISTANT',
      systemPrompt: 'You are a helpful customer support agent...',
    temperature: 0.7,
      maxTokens: 2000,
      model: 'gpt-4'
    }
  })
});

const result = await response.json();
console.log('Created persona:', result.result.data);

Simple Code Block

JSON
{
  "id": "clx1abc123xyz789",
  "name": "Customer Support Agent",
  "type": "ASSISTANT",
  "temperature": 0.7,
  "maxTokens": 2000,
  "model": "gpt-4",
  "createdAt": "2025-01-15T10:30:00.000Z"
}

Callouts

Note

This is a note callout. Use it to provide additional context or explanations about API usage or features.

Pro Tip

Set the temperature between 0.7-0.9 for more creative responses, or 0.1-0.3 for more deterministic outputs. Use structured system prompts for consistent persona behavior.

Warning

Make sure to keep your API keys secure. Never commit them to version control or expose them in client-side code. Use environment variables for all secrets.

Success

Congratulations! You've successfully created your first persona. You can now start creating chat sessions and sending messages.

Error

Authentication failed. Please check that your API key is valid and that you're including both the X-API-Key and X-Organization-ID headers.

Important Security Notice

This endpoint will permanently delete the persona and all associated chat sessions and messages. This action cannot be undone.

Interactive API Examples

List All Personas

Retrieve all personas in your organization

GET

Create New Persona

Create a new AI persona with custom settings

POST

Send Message

Send a message to a chat session and receive an AI response

POST

Create Chat Session

Create a new chat session with a persona

POST

Component Features

Code Blocks

  • Syntax highlighting for 20+ languages
  • Line numbers and highlight support
  • Copy to clipboard functionality
  • File names and titles
  • Multi-language tabs

Callouts

  • 6 different callout types
  • Custom titles and icons
  • Dark mode support
  • Accessible design
  • Responsive layout

API Examples

  • tRPC and REST endpoint support
  • cURL command generation
  • Request body display
  • Authentication header examples
  • Copy examples to clipboard

Search & Navigation

  • Full-text search across docs
  • Categorized search results
  • Keyboard shortcuts
  • Instant search results
  • Mobile responsive design