https://retellai.com/?utm_source=discord&utm_medium=seo logo
I need to init calls with the same agent (due to t...
# ❓・ai-evy-support
g
@AI Evy I need to init calls with the same agent (due to tool calls) although with a different system prompt for each one. Currently I'm creating "llm" objects for each system prompt then using agent_override and providing them under the response engine. When providing an llm under agent override, I'm getting a 500 error. Is this proper?
a
Thanks for tagging me @Gleeming. I'll look through relevant sources and get back to you shortly.
​ To learn more, see the sources I considered: [[1] Create Web Call](https://docs.retellai.com/api-references/create-web-call) [[2] Inbound webhook](https://docs.retellai.com/features/inbound-call-webhook) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
### Answer Based on the documentation, you cannot pass a full LLM object under
agent_override
. The
agent_override.retell_llm
field only supports overriding specific attributes of the Retell LLM configuration, not replacing it with an entirely different LLM. [(1) ]() The supported attributes for
agent_override.retell_llm
are:
model
,
s2s_model
,
model_temperature
,
model_high_priority
,
tool_call_strict_mode
,
knowledge_base_ids
,
kb_config
,
start_speaker
,
begin_after_user_silence_ms
,
begin_message
. Notably,
general_prompt
(the system prompt) is not listed among the supported override attributes for
retell_llm
. For your use case of using different system prompts per call while keeping the same tools, you have a couple of options: 1. Use
retell_llm_dynamic_variables
— Inject dynamic variables into your prompt at call time.
Copy code
json
{ "customer_name": "John Doe" }
2. Create separate agents — Each with the desired system prompt but sharing the same tool configurations. 3. Use the inbound webhook — If handling inbound calls, you can use
override_agent_id
to dynamically select a different agent per call. [(2) ]() The 500 error you're receiving is likely because you're passing an unsupported structure to
agent_override.retell_llm
.
g
@AI Evy This is what I'm using to init the call: const response = await retellClient.call.createPhoneCall({ from_number: '', to_number: customer.phoneNumber, agent_override: { agent: { voice_id: '11labs-Adrian', response_engine: { type: "retell-llm", llm_id: "llm_720c7d1d00916b1a6ddca3fc295e" } } }, override_agent_id: 'agent_40801cf42ecf2b00dd8dffe3e0', retell_llm_dynamic_variables: { company_name: customer.companyId.replaceAll("_", " "), company_id: customer.companyId, customer_id: customer.id, customer_name: customer.firstname + " " + customer.lastname, customer_phone: customer.phoneNumber, customer_email: customer.email, total: customer.balance.toString(), due_date: customer.balanceAge, }, });
a
Thanks for the follow-up, @Gleeming. I'll get back to you soon.
### Answer Looking at your code, the issue is that the
agent_override
structure you're using doesn't match the supported schema. [(1) ]() The
agent_override.agent
object supports overriding agent configuration settings, but the documentation for
agent_override.retell_llm
specifies only these supported attributes:
model
,
s2s_model
,
model_temperature
,
model_high_priority
,
tool_call_strict_mode
,
knowledge_base_ids
,
kb_config
,
start_speaker
,
begin_after_user_silence_ms
,
begin_message
. [(2) ]() Passing a full
response_engine
object with
llm_id
is not listed among the supported override attributes—this is likely causing your 500 error. Alternative approaches: 1. Use
override_agent_id
alone
— Point to different agents that already have the desired LLM/prompt configured. [(1) ]() 2. Leverage dynamic variables — If your prompts differ only by injected data, use
retell_llm_dynamic_variables
(which you're already doing) and design your base prompt to handle the variations. [(1) ]() [(3) ]() 3. Create separate agents — Each with the specific system prompt you need, then use
override_agent_id
to select the appropriate one per call. Your
retell_llm_dynamic_variables
usage looks correct. [(1) ]()
​ To learn more, see the sources I considered: [[1] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[2] Register Phone Call](https://docs.retellai.com/api-references/register-phone-call) [[3] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the feedback, glad I was helpful.