https://retellai.com/?utm_source=discord&utm_medium=seo logo
How can i give a prompt and equation in the same t...
# ❓・ai-evy-support
a
@AI Evy How can i give a prompt and equation in the same transition of a specific conversation node ? Ex: I want to check {{isBookAppointmentEnabledForVoice}} is True and the prompt will be "If the customer is indicating that they want to book an appointment/service call/reservation etc"
a
Thanks for tagging me @afrah_85175. I'll look through relevant sources and get back to you shortly.
### Answer Based on the documentation, you cannot combine both prompt and equation conditions in a single transition condition [(1) ]() . Retell AI's conversation flow uses two distinct types of transition conditions : 1. Prompt conditions - evaluated by the LLM 2. Equation conditions - mathematical equations that are hardcoded The system evaluates all equation conditions first, then prompt conditions . Equation conditions are evaluated from top to bottom, and the system transitions on the first condition that evaluates to true . For your specific use case, you would need to create two separate transition conditions: 1. An equation condition:
{{isBookAppointmentEnabledForVoice}} == true
2. A prompt condition: "If the customer is indicating that they want to book an appointment/service call/reservation etc" However, since equation conditions are evaluated first and from top to bottom , if your equation condition evaluates to true, the agent will transition before evaluating the prompt condition. This means you cannot achieve the AND logic you're looking for with the current transition condition system. You might need to restructure your conversation flow to handle this scenario, perhaps by using the equation condition to route to an intermediate node that then uses the prompt condition for the final transition.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) ​
a
@AI Evy Hey in this prompt this condition is not working # Objective: Answer the customer's question by following the guidelines mentioned below. # Instructions 1. Use the context in ## Related Knowledge Base Contexts, answer the customer question. 2. Generate an answer to the point. 3. Finish by following the instructions in ## Follow up action section. ## Follow up action Finish by saying one of the follow up actions or their variations. You can also decide randomly to skip saying the follow up action: If {{isBookappointmentEnabledForVoice}} == True and If an {appointment/reservation/service} hasn't been booked already in this conversation, you can follow up with: - "{{ask_to_book_service_message}}" else you can randomly choose any one of the following suggestions: - "Anything else I can answer for you?" - "Do you have any other questions?" - "Let me know if there's something else you're want to know about" - "Is there anything else you'd like to know?" - "{{default_followup_message}}" # General Conversation Guidelines: 1. Maintain a cordial, professional phone‑call tone. 2. Speak in first person as the owner or team member. 3. Keep replies informal, less than  35 words. 4. Only share names, stats, numbers, prices or sensitive data if in the knowledge base. 5. Politically, religiously or sexually sensitive topics: politely decline. 6. Stay on‑topic within the industry in which the business operates. 8. Never discuss HIPAA‑sensitive information. If {{isBookappointmentEnabledForVoice}} == True
a
Thanks for the follow-up, @afrah_85175. I'll get back to you soon.
### Answer The issue you're experiencing is that dynamic variables like
{{isBookappointmentEnabledForVoice}}
cannot be used with equation syntax (
== True
) directly within prompts [(1) ]() . According to the documentation, equation conditions are specifically designed for transition conditions, not for use within node instructions or prompts . In your prompt, you're trying to use equation syntax within the instruction text itself, but this won't work as expected. Dynamic variables in prompts are meant to be simple substitutions, not conditional logic . For your use case, you have a few options: 1. **Use transition conditions instead**: Move this logic to equation-based transition conditions that route to different nodes based on the variable value 2. **Simplify the prompt logic**: Instead of using equation syntax, write the conditional logic in natural language that the LLM can interpret, such as:
Copy code
If booking appointments is enabled for voice calls, and no appointment has been booked yet in this conversation, you can follow up with: "{{ask_to_book_service_message}}"
3. **Use separate nodes**: Create different conversation nodes for when
{{isBookappointmentEnabledForVoice}}
is true vs false, and use equation-based transition conditions to route between them The equation syntax like
{{isBookappointmentEnabledForVoice}} == True
is specifically for transition conditions between nodes, not for conditional logic within the prompt text itself .
​ To learn more, see the sources I considered: [[1] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy i want to use this prompt in the conversation node itself, not the transition. Can you help?
a
Thanks for the follow-up, @afrah_85175. I'll get back to you soon.
### Answer Based on the available sources, I don't have specific documentation about using equation syntax within conversation node prompts themselves. The sources focus on transition conditions rather than conditional logic within node instructions [(1) ]() . However, for your conversation node prompt, you can handle this by writing the conditional logic in natural language that the LLM can interpret, rather than using equation syntax. The conversation node supports both Prompt and Static Sentence instruction types . For your specific use case, you could structure your prompt like this:
Copy code
# Objective:
Answer the customer's question by following the guidelines mentioned below.

# Instructions
1. Use the context in ## Related Knowledge Base Contexts, answer the customer question. 
2. Generate an answer to the point.
3. Finish by following the instructions in ## Follow up action section.

## Follow up action
If appointment booking is enabled for voice calls and no appointment has been booked in this conversation yet, follow up with: "{{ask_to_book_service_message}}"

Otherwise, randomly choose one of these suggestions:
- "Anything else I can answer for you?"
- "Do you have any other questions?"
- "Let me know if there's something else you want to know about"
- "Is there anything else you'd like to know?"
- "{{default_followup_message}}"

# General Conversation Guidelines:
1. Maintain a cordial, professional phone‑call tone.
2. Speak in first person as the owner or team member.
3. Keep replies informal, less than 35 words.
4. Only share names, stats, numbers, prices or sensitive data if in the knowledge base.
5. Politically, religiously or sexually sensitive topics: politely decline.
6. Stay on‑topic within the industry in which the business operates.
8. Never discuss HIPAA‑sensitive information.
This approach lets the LLM interpret the conditional logic naturally rather than trying to use equation syntax within the prompt text .
​ To learn more, see the sources I considered: [[1] Conversation Node](https://docs.retellai.com/build/conversation-flow/conversation-node) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy When multilingual option is enabled, when the user asks any question in Spanish, the answer of the voie agent should be in spanish. but it is in english. How to solve this issue ?
a
Thanks for the follow-up, @afrah_85175. I'll get back to you soon.
### Answer The multilingual feature in Retell AI requires specific configuration. Based on the available sources, you need to set the language parameter to
multi
for multilingual support [(1) ]() [(2) ]() . The documentation indicates that selecting
multi
for multilingual support currently supports Spanish and English . To enable multilingual support, set the
language
parameter to
"multi"
when creating or updating your agent :
Copy code
javascript
const agentResponse = await client.agent.create({
 response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },
 voice_id: '11labs-Adrian',
 language: "multi"
}) ;
[(2) ]() According to the changelog, multilingual support has been expanded and now supports seamlessly switching between English, Spanish, French, German, Hindi, Russian, Portuguese, Japanese, Italian, and Dutch [(3) ]() . However, based on Discord discussions, there are some limitations. One user mentioned that multilingual support only works with Deepgram voices [(4) ]() , and another user indicated you should "choose multi-english&spanish in language" [(5) ]() . If your agent is still responding in English when users speak Spanish, you may need to: 1. Ensure you're using a compatible voice (Deepgram voices for multilingual support) [(4) ]() 2. Verify the
language
parameter is set to
"multi"
[(1) ]() [(2) ]() 3. Check that your prompt instructions don't explicitly force English responses The available sources don't provide detailed troubleshooting steps for this specific issue, so you may need additional support for more specific configuration guidance.
​ To learn more, see the sources I considered: [[1] Get Agent](https://docs.retellai.com/api-references/get-agent) [[2] Create Agent](https://docs.retellai.com/api-references/create-agent) [[3] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) [[4] Multilingual Agent (two agents with transfer)](https://discord.com/channels/1186424376300679209/1270169781831602187) [[5] Multilingual support](https://discord.com/channels/1186424376300679209/1321626490097504286) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.