https://retellai.com/?utm_source=discord&utm_medium=seo logo
Is there a way to send text chat in web call
# ask-retell-partners
u
@AI Evy Is there a way to send text chat in web call ?
a
Thanks for tagging me @10v32616. I'll look through relevant sources and get back to you shortly.
### Answer Retell doesn't support typing into an active voice call, but you can add a chat widget alongside it [(1) ]() . You can convert your voice agent into a Chat Agent in Retell, embed the widget with their
<script>
, and users can type or talk using the same flow . You can create a chat session using the Chat API [(2) ]() :
Copy code
javascript
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) ;
This allows you to have both voice and text functionality using the same agent logic, though they would be separate interfaces rather than integrated text input within the voice call itself [(1) ]() .
​ To learn more, see the sources I considered: [[1] Adding text input to Web Call (Voice)](https://discord.com/channels/1186424376300679209/1397443098044530818) [[2] Create Chat](https://docs.retellai.com/api-references/create-chat) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
u
a
Thanks for the follow-up, @10v32616. I'll get back to you soon.
### Answer Không, hai API này hoạt động khác nhau [(1) ]() [(2) ]() . Create Chat API tạo một phiên chat dựa trên văn bản [(1) ]() :
Copy code
javascript
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) ;
Create Web Call API tạo một cuộc gọi thoại qua web [(2) ]() :
Copy code
javascript
const webCallResponse = await client.call.createWebCall({ agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD' }) ;
console.log(webCallResponse.agent_id) ;
Sự khác biệt chính: - Create Chat trả về
chat_id
và được thiết kế cho tương tác văn bản [(1) ]() - Create Web Call trả về
access_token
và
call_id
cho cuộc gọi thoại qua web [(2) ]() - Web Call có các tính năng như transcript, recording_url, và latency tracking - Chat có message_with_tool_calls và chat_analysis [(1) ]() Cả hai đều sử dụng cùng agent_id nhưng tạo ra các loại phiên tương tác khác nhau [(1) ]() [(2) ]() .
​ To learn more, see the sources I considered: [[1] Create Chat](https://docs.retellai.com/api-references/create-chat) [[2] Create Web Call](https://docs.retellai.com/api-references/create-web-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
u
@AI Evy tôi đã sử dụng theo Create Chat API, nhưng session trả về là 404 not found
a
Thanks for the follow-up, @10v32616. I'll get back to you soon.
### Answer Dựa trên tài liệu Create Chat API [(1) ]() , có một số nguyên nhân phổ biến gây ra lỗi 404 Not Found: 1. Kiểm tra endpoint URL Endpoint chính xác là: `POST 2. Xác thực Authorization header Đảm bảo header được format đúng :
Copy code
Authorization: Bearer YOUR_RETELL_API_KEY
3. Kiểm tra agent_id Đảm bảo
agent_id
tồn tại và đã được publish . Dựa trên một trường hợp tương tự [(2) ]() , có thể agent đã được tạo nhưng không xuất hiện trong API do vấn đề hệ thống. 4. Sử dụng đúng SDK Code mẫu chính xác từ tài liệu [(1) ]() :
Copy code
javascript
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) ;
5. Kiểm tra các tham số bắt buộc API yêu cầu
agent_id
là bắt buộc . Nếu vẫn gặp lỗi 404, hãy kiểm tra xem agent có thực sự tồn tại bằng cách sử dụng API list agents hoặc liên hệ support để xác minh vấn đề hệ thống [(2) ]() .
​ To learn more, see the sources I considered: [[1] Create Chat](https://docs.retellai.com/api-references/create-chat) [[2] Agent exists and is published, but API returns "Found agents: 0"](https://discord.com/channels/1186424376300679209/1392892371313754164) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
u
Error creating chat session: 422 Cannot start a chat session with selected agent. this is what i get when I use api : const chatResponse = await client.chat.create({ agent_id: ' ' }) ;
@AI Evy Error creating chat session: 422 Cannot start a chat session with selected agent. this is what i get when I use api : const chatResponse = await client.chat.create({ agent_id: ' ' }) ;
a
Thanks for the follow-up, @10v32616. I'll get back to you soon.
### Answer ### Answer Lỗi 422 "Cannot start a chat session with selected agent" thường xảy ra khi agent không được cấu hình đúng cho chat sessions [(1) ]() . Dựa trên tài liệu Create Chat API, có một số điều cần kiểm tra: 1. Kiểm tra agent_id hợp lệ Đảm bảo agent_id không để trống và tồn tại trong hệ thống :
Copy code
javascript
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) ;
2. Xác minh agent configuration Sử dụng Get Agent API để kiểm tra cấu hình agent [(2) ]() :
Copy code
javascript
const agentResponse = await client.agent.retrieve('16b980523634a6dc504898cda492e939') ;
console.log(agentResponse.agent_id) ;
3. Kiểm tra response_engine Agent phải có response_engine được cấu hình đúng . Trong response từ Get Agent API, bạn sẽ thấy:
Copy code
json
{
 "response_engine": {
 "type": "retell-llm",
 "llm_id": "llm_234sdertfsdsfsdf",
 "version": 0
 }
}
4. Kiểm tra trạng thái published Agent cần được published để có thể sử dụng trong chat sessions . Kiểm tra field
is_published
trong response:
Copy code
json
{
 "is_published": false
}
Nếu
is_published
là
false
, bạn cần publish agent trước khi có thể tạo chat session .
​ To learn more, see the sources I considered: [[1] Create Chat](https://docs.retellai.com/api-references/create-chat) [[2] Get Agent](https://docs.retellai.com/api-references/get-agent) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
u
@AI Evy Agent không được published, dù tôi đã bấm published
a
Thanks for the follow-up, @10v32616. I'll get back to you soon.
### Answer Vấn đề này có thể do một số nguyên nhân. Dựa trên tài liệu và thông tin từ cộng đồng: 1. Kiểm tra trạng thái agent hiện tại Sử dụng Get Agent API để xác minh trạng thái published [(1) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.retrieve('16b980523634a6dc504898cda492e939') ;
console.log(agentResponse.agent_id) ;
2. Hiểu về agent versioning Theo thông tin từ cộng đồng, một khi version đã được published, cấu hình agent cho version đó không thể được sửa đổi [(2) ]() . Khi bạn cập nhật agent, hệ thống tạo ra version mới với
is_published: false
. 3. Vấn đề với LLM updates Từ thảo luận cộng đồng, khi bạn update LLM prompt qua API, agent sẽ tiếp tục sử dụng prompt từ published version chứ không phải draft version được tạo khi update [(3) ]() . Để giải quyết, bạn có thể: - Tạo LLM mới qua API - Update agent để sử dụng LLM ID mới 4. Vấn đề identity verification Trong một số trường hợp, agent không thể publish do chưa hoàn thành identity verification [(4) ]() . Kiểm tra xem bạn đã verify identity chưa. 5. Giải pháp khuyến nghị Thay vì patch existing LLM, hãy tạo LLM mới và update agent để sử dụng LLM mới đó [(3) ]() . Nếu vấn đề vẫn tiếp tục, hãy liên hệ: - Visit [Contact Sales]() - Visit [)
​ To learn more, see the sources I considered: [[1] Get Agent](https://docs.retellai.com/api-references/get-agent) [[2] is_published" property of agents is not updating via "update agent " Api](https://discord.com/channels/1186424376300679209/1384428840247361587) [[3] Discord message from @userrk1329 on 2025-08-13](https://discord.com/channels/1186424376300679209/1294891368505937952/1405073658904444969) [[4] Unable to publishing](https://discord.com/channels/1186424376300679209/1376309826195423253) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
u
@AI Evy cách để publish agent lại sau khi update
a
Thanks for the follow-up, @10v32616. I'll get back to you soon.
### Answer Based on the available sources, I can see information about updating agents and a community discussion about publishing, but I don't have specific official documentation about a publish agent API endpoint. Theo thông tin từ cộng đồng, có một giải pháp thay thế để agent sử dụng version mới sau khi update [(1) ]() : Giải pháp được khuyến nghị: 1. Tạo LLM mới thay vì patch LLM hiện tại 2. Update agent để sử dụng LLM ID mới Cách thực hiện:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;

// Update agent với response_engine mới
const agentResponse = await client.agent.update('16b980523634a6dc504898cda492e939', { 
 response_engine: { 
  llm_id: 'llm_new_id', 
  type: 'retell-llm' 
 }
}) ;
[(2) ]() Giải pháp từ cộng đồng: Theo thảo luận, bạn có thể set agent ở draft version từ dashboard tại tab phone numbers, sau đó mọi thay đổi qua API hoặc dashboard sẽ có hiệu lực mà không cần publish [(3) ]() . Tôi không tìm thấy endpoint chính thức để publish agent qua API trong tài liệu hiện có. Nếu bạn cần giải pháp chính xác cho việc publish agent, hãy liên hệ: - Visit [Contact Sales]() - Visit [) Bạn có muốn tôi cung cấp thêm thông tin chung dựa trên kiến thức của mình không?
​ To learn more, see the sources I considered: [[1] Discord message from @userrk1329 on 2025-08-13](https://discord.com/channels/1186424376300679209/1294891368505937952/1405073658904444969) [[2] Update Agent](https://docs.retellai.com/api-references/update-agent) [[3] Discord message from @userrk1329 on 2025-08-13](https://discord.com/channels/1186424376300679209/1294891368505937952/1405220586338390186) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
u
@AI Evy cách chỉ định phiên bản của agent là như thế nào, có vẻ như do draft version nên agent luôn mặc định set default là published false
a
Thanks for the follow-up, @10v32616. I'll get back to you soon.
### Answer ### Answer Để chỉ định phiên bản của agent, bạn có thể sử dụng tham số
version
trong các API call [(1) ]() [(2) ]() : Cách sử dụng version number trong API:
Copy code
javascript
get_agent(version=2) ///# Gets the version with version number 2.
get_agent() ///# Gets the latest version of the agent.
[(1) ]() Lấy agent với version cụ thể:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.retrieve('16b980523634a6dc504898cda492e939') ;
console.log(agentResponse.agent_id) ;
[(2) ]() Trong Get Agent API, bạn có thể thêm query parameter
version
: -
version
(integer) : Optional version của API để sử dụng cho request này. Nếu không cung cấp, sẽ mặc định là latest version Quản lý version qua dashboard: Theo thông tin từ cộng đồng, bạn có thể set agent ở draft version từ dashboard tại tab "Phone Numbers", sau đó mọi thay đổi qua API hoặc dashboard sẽ có hiệu lực mà không cần publish [(3) ]() . Xem tất cả versions của agent:
Copy code
javascript
const agentResponses = await client.agent.getVersions('16b980523634a6dc504898cda492e939') ;
console.log(agentResponses) ;
[(4) ]() Hiểu về versioning: - Khi bạn tạo version mới bằng cách click "Deployment" button, nó sẽ tạo version mới của agent và corresponding retell_llm hoặc conversation flow [(1) ]() - Một khi version đã được published, cấu hình agent cho version đó không thể thay đổi - Nếu bạn chọn
Draft
trong Phone Numbers tab, nó sẽ luôn fetch latest version của agent Version number có thể được sử dụng: - Trong
get_agent
hoặc
get_retell_llm
API - Trong creating calls như
create_web_call
- Trong
create_phone_number
để đảm bảo phone sử dụng đúng version của agent
​ To learn more, see the sources I considered: [[1] Setup versioning for agents](https://docs.retellai.com/agent/version) [[2] Get Agent](https://docs.retellai.com/api-references/get-agent) [[3] Discord message from @omar.13. on 2025-08-13](https://discord.com/channels/1186424376300679209/1294891368505937952/1405226164376571948) [[4] Get Agent Versions](https://docs.retellai.com/api-references/get-agent-versions) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
u
@AI Evy Khi switch agent từ voice qua chat, và ngược lại, thì người dùng khác có bị ảnh hưởng không, khi sử dụng cùng một agent ?
a
Thanks for the follow-up, @10v32616. I'll get back to you soon.
### Answer ### Answer Không, việc switch agent từ voice qua chat và ngược lại không ảnh hưởng đến người dùng khác khi sử dụng cùng một agent [(1) ]() [(2) ]() . Lý do: 1. **Mỗi session độc lập**: Mỗi voice call và chat session đều có ID riêng biệt [(2) ]() . Khi tạo chat session:
Copy code
javascript
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) ;
2. **Agent như template**: Agent hoạt động như một template có thể được sử dụng đồng thời cho nhiều sessions khác nhau [(1) ]() [(2) ]() . Việc convert từ voice agent sang chat agent chỉ thay đổi cấu hình agent, không ảnh hưởng đến các sessions đang hoạt động. 3. **Conversation history riêng biệt**: Mỗi chat session có
transcript
và
message_with_tool_calls
riêng [(2) ]() , không chia sẻ với sessions khác. 4. **Hạn chế khi convert**: Khi convert voice agent sang chat agent, các tính năng voice-specific như call transfers, DTMF, hoặc telephony features sẽ bị loại bỏ [(1) ]() , nhưng điều này không ảnh hưởng đến sessions đang hoạt động. **Lưu ý**: Conversation history được tự động lưu trữ trong database của Retell, và bạn không cần quản lý conversation context [(3) ]() .
​ To learn more, see the sources I considered: [[1] Create chat agent](https://docs.retellai.com/build/create-chat-agent) [[2] Create Chat](https://docs.retellai.com/api-references/create-chat) [[3] Create Chat Completion](https://docs.retellai.com/deploy/create-chat-completion) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
u
@AI Evy liệu có vấn đề gì không, khi agent đang đợi response từ call, mà tôi lại chuyển thành chat và trả lời ?
a
Thanks for the follow-up, @10v32616. I'll get back to you soon.
### Answer ### Answer Có, điều này có thể gây ra vấn đề nghiêm trọng. Dựa trên tài liệu Create Chat Completion API [(1) ]() , mỗi chat session và voice call là các phiên hoàn toàn độc lập với nhau. Vấn đề khi chuyển từ call sang chat: 1. **Session riêng biệt**: Voice call và chat session có ID khác nhau . Khi agent đang đợi response từ call mà bạn chuyển sang chat, bạn đang tạo session mới hoàn toàn. 2. **Context bị mất**: Chat session mới sẽ không có context từ voice call đang diễn ra . Agent trong chat sẽ không biết về cuộc hội thoại voice đang chờ response. 3. **Voice call vẫn chờ**: Voice call gốc vẫn sẽ tiếp tục chờ response từ người dùng, có thể dẫn đến timeout hoặc trạng thái không xác định. Code để tạo chat completion:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const response = await client.chat.createChatCompletion({
 chat_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
 content: 'hi how are you doing?',
}) ;
console.log(response.messages) ;
**Khuyến nghị**: Nên hoàn thành voice call trước khi chuyển sang chat session, hoặc sử dụng một trong hai phương thức giao tiếp để tránh confusion và đảm bảo trải nghiệm người dùng nhất quán .
​ To learn more, see the sources I considered: [[1] Create Chat Completion](https://docs.retellai.com/api-references/create-chat-completion) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
u
@AI Evy tôi sẽ quản lý kĩ transcription nên về nội dung sẽ luôn liền mạch, như vậy có thể phát sinh thêm vấn đề nào khác không
a
Thanks for the follow-up, @10v32616. I'll get back to you soon.
### Answer Thanks for the follow-up, @10v32616. I'll get back to you soon. ### Answer Mặc dù bạn quản lý transcription để đảm bảo nội dung liền mạch, vẫn có thể phát sinh một số vấn đề kỹ thuật khác: 1. Vấn đề về session state Voice call và chat session có các state khác nhau [(1) ]() . Voice call có thể đang ở trạng thái
in_progress
, trong khi chat session bắt đầu từ trạng thái mới. 2. Tool calling behavior khác biệt Chat sessions có
message_with_tool_calls
, trong khi voice calls có cơ chế tool calling khác. Nếu agent đang chờ tool response từ voice call, việc chuyển sang chat có thể gây confusion. 3. Timing và latency issues Voice calls có real-time constraints với end-to-end latency < 800ms, trong khi chat không có yêu cầu này. Việc chuyển đổi có thể tạo ra timing mismatch. 4. Session cleanup Voice call gốc vẫn cần được properly terminated để tránh resource leaks:
Copy code
javascript
// Voice call cần được end properly
const callResponse = await client.call.end('call_id') ;
5. Analytics và tracking Hai sessions sẽ tạo ra separate analytics records, có thể gây khó khăn trong việc tracking complete conversation journey. 6. Concurrent limitations Nếu có rate limits hoặc concurrent session limits, việc có cả voice call và chat session đồng thời có thể gây vấn đề. **Khuyến nghị**: Ngay cả khi quản lý transcription tốt, nên implement proper session transition logic để ensure clean handoff giữa voice và chat modes. ​ To learn more, see the sources I considered: [[1] Create Chat]() ​ Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
message has been deleted
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.