Conversation modes
Pearl API supports four distinct conversation modes through a single endpoint, allowing you to select the appropriate interaction for each user query.
AI-only response mode ("pearl-ai")Copied!
Provides fast, AI-generated answers using Pearl's extensive knowledge base without human review.
response = client.chat.completions.create(
model="pearl-ai",
messages=[
{
"role": "user",
"content": "Explain to me how AI works"
}
],
metadata={
"sessionId": session_id,
"mode": "pearl-ai"
}
)
AI with expert verification mode ("pearl-ai-verified")Copied!
Generates AI answers that are automatically reviewed by qualified human experts before being returned to the user.
response = client.chat.completions.create(
model="pearl-ai",
messages=[
{
"role": "user",
"content": "Explain to me how AI works"
}
],
metadata={
"sessionId": session_id,
"mode": "pearl-ai-verified"
}
)
AI with expert transition mode ("pearl-ai-expert")Copied!
Begins with AI-powered intake questions to gather information, then seamlessly transitions to a conversation with a qualified human expert.
response = client.chat.completions.create(
model="pearl-ai",
messages=[
{
"role": "user",
"content": "Explain to me how AI works"
}
],
metadata={
"sessionId": session_id,
"mode": "pearl-ai-expert"
}
)
Direct expert connection mode ("expert")Copied!
Immediately routes the query to a qualified human expert, bypassing the AI interaction entirely.
response = client.chat.completions.create(
model="pearl-ai",
messages=[
{
"role": "user",
"content": "Explain to me how AI works"
}
],
metadata={
"sessionId": session_id,
"mode": "expert"
}
)
Note: For expert-involved modes (pearl-ai-verified, pearl-ai-expert, and expert), the process may take some time as it is being done by a human Expert. The duration depends on factors such as answer complexity and expert availability. If you wish to get an AI answer verification or connect with a real human Expert, you must implement automatic retries or setup webhook callbacks as described in later sections.