Adrian Mateos
10/06/2025, 10:39 AMAI Evy
10/06/2025, 10:39 AMAI Evy
10/06/2025, 10:39 AMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const chatResponse = await client.chat.create({ agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD' }) ;
console.log(chatResponse.agent_id) ;
The API returns comprehensive data about the chat session including the transcript, message history, chat analysis, and chat success status . This makes it suitable for automated testing scenarios where you need to verify agent responses and conversation flow .
Additionally, the documentation mentions that you can simulate conversations and test through audio as well [(2) ]() . You can test the LLM and simulate conversations to verify the logic and flow transitions .
For more comprehensive testing automation, you would typically create multiple chat sessions with different test scenarios and analyze the returned data to verify your chatbot's performance.AI Evy
10/06/2025, 10:40 AMAI Evy
10/06/2025, 10:40 AMAdrian Mateos
10/06/2025, 10:41 AMAdrian Mateos
10/06/2025, 10:41 AMAI Evy
10/06/2025, 10:41 AMAI Evy
10/06/2025, 10:41 AMpython
from retell.types import ChatResponse, ChatListResponse, ChatCreateChatCompletionResponse
[(1) ]()
To create a chat session, you can use the Python SDK with the following method:
python
client.chat.create(**params) -> ChatResponse
The Python SDK provides several chat-related methods for automated testing :
- client.chat.create() - Create a chat session
- client.chat.retrieve(chat_id) - Retrieve chat details
- client.chat.list() - List chat sessions
- client.chat.create_chat_completion(**params) - Create chat completions
- client.chat.end(chat_id) - End a chat session
For comprehensive automated testing, you would create multiple chat sessions with different test scenarios and analyze the returned ChatResponse data to verify your chatbot's performance . The response includes transcript, message history, chat analysis, and success status - all useful for automated validation [(2) ]() .AI Evy
10/06/2025, 10:41 AMAI Evy
10/06/2025, 10:41 AM