https://retellai.com/?utm_source=discord&utm_medium=seo logo
I'm currently running GPT 4
# ❓・ai-evy-support
h
@AI Evy I'm currently running GPT 4.1 instead of GPT 40 because of obviously the deprecation GPT 4.0 performed well for me to get deprecated so I'm now obviously switched to this current model and it is occasionally hallucinating times based off like the user sentiment with success with GPT41. How would I actually I guess like prompted to have flawless booking logic because currently I'm receiving iso 8601 time strings. And my assistant is hallucinating because I'm trying to do time zone conversion logic like obviously I'm instructing my assistant to know that the current time strings available from the tool that it checked from my calendar is in Australian eastern time and then it asks for the users time zone and stuff like that, and it needs to cross match it so like obviously the users preferred time it cross matches it with the available time stringthat is present in the check slot tool, but it is just hallucinating it saying times exist when they don't I'll give you my current prompt. You can just check what is wrong but I don't know what is wrong. I don't know if it's the model. I don't know what it is, but I'm really just like not getting good results with GPT 4.1 would u like to see my prompt?
a
Thanks for tagging me @hans_70884. I'll look through relevant sources and get back to you shortly.
​ To learn more, see the sources I considered: [[1] Prompt Engineering Guide](https://docs.retellai.com/build/prompt-engineering-guide) [[2] Time Zone Issue](https://discord.com/channels/1186424376300679209/1344216990830559263) [[3] List Retell LLMs](https://docs.retellai.com/api-references/list-retell-llms) ​
Consider Conversation Flow If your agent handles complex logic with multiple tools, consider switching to Conversation Flow agents instead of Single Prompt [(1) ]() . Conversation Flow provides: - Deterministic tool calling per node - Each node focuses on one specific task - More predictable agent behavior Dynamic Variables Use dynamic variables to inject timezone and available slots directly into your prompt context [(3) ]() :
Copy code
default_dynamic_variables: {
  "calendar_timezone": "Australia/Brisbane",
  "user_timezone": "{{user_timezone}}"
}
Once you share your prompt, I can provide more specific guidance on where hallucinations might be occurring.
### Answer --- Yes, please share your prompt. Based on the available sources, here are several strategies to reduce hallucinations in your booking logic with GPT-4.1 [(1) ]() : Explicit Tool Calling Instructions Define clear triggers for when to call your booking functions . In your prompt, specify exact conditions:
Copy code
## Tool Usage Instructions
1. ALWAYS call check_slot_availability BEFORE suggesting any appointment time
2. ONLY suggest times that are explicitly returned in the check_slot_availability response
3. NEVER invent or assume available times
Structured Prompt Sections Break your prompt into focused sections for better LLM comprehension :
Copy code
## Identity
You are an appointment booking assistant for [Company Name].

## Style Guardrails
Be concise: Keep responses under 2 sentences unless explaining complex topics.
Be accurate: Only suggest times returned by the booking system.

## Response Guidelines
Return dates in spoken form: Say "January fifteenth" not "1/15".
Confirm timezone: Always verify the user's timezone before suggesting times.

## Task Instructions
1. Ask for user's preferred date and timezone
2. Call check_slot_availability with user's timezone
3. Present ONLY the times returned by the system
4. Confirm the booking details before finalizing
Time Zone Handling For time zone conversion, include explicit instructions in your prompt [(2) ]() :
Copy code
## Timezone Instructions
- Always ask the user for their timezone
- Convert all times to the user's timezone before presenting them
- State the timezone when confirming appointment times
- Use Australia/Brisbane as the calendar's base timezone
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
h
@AI Evy ##OVERWRITE BOOKING IMPORTANT All slots from check_slots are in Australia/Sydney (AEDT). Current time reference = {{current_time_Australia/Sydney}}. When speaking times, convert AEDT to the user’s local timezone only for display; never convert timestamps before booking. A time is valid only if it maps directly to an exact ISO timestamp in the most recent check_slots array. If the user requests a time that does not map to an ISO timestamp, respond: "That time isn’t available." and then immediately list real available slots for that same day using only ISO timestamps from check_slots. Never infer, approximate, round, or generate “closest” times. Never create new times based on offsets. Never speak a time unless it originates directly from a valid ISO timestamp. If no match exists, do not speak a time; only reject and show real options. Mapping: take user-spoken local time, translate to AEDT to locate the matching ISO timestamp, then speak the corresponding local-timezone value back to the user. If mapping is unclear, ask for clarification. When booking, pass the exact ISO timestamp from check_slots, character-for-character, without formatting changes, conversion, or offset modification. Only book after explicit, unambiguous confirmation of a specific slot. If unclear, ask for clarity before booking. Use {{name}} unless the user verbally states a different name as their own. here was my prompt what is wrong
a
Thanks for the follow-up, @hans_70884. I'll get back to you soon.
### Answer Your prompt has several issues that could cause hallucinations with GPT-4.1: ## Key Problems 1. Timezone Dynamic Variable Syntax You're using
{{current_time_Australia/Sydney}}
but the correct syntax is
{{current_time_Australia/Sydney}}
[(1) ]() . The system variable format requires the underscore between
current_time
and the timezone . 2. Missing Calendar Context Consider adding
{{current_calendar_Australia/Sydney}}
to provide the agent with a 14-day calendar view in AEDT . This gives the LLM better temporal context when matching user requests to available slots . 3. Overly Complex Single Instruction Block Your entire booking logic is in one dense paragraph. GPT-4.1 performs better with structured, sectioned prompts. Break this into clear sections:
Copy code
## Timezone Configuration
- Calendar timezone: Australia/Sydney (AEDT)
- Current time: {{current_time_Australia/Sydney}}
- Current calendar: {{current_calendar_Australia/Sydney}}

## Slot Validation Rules
1. A time is valid ONLY if it maps to an exact ISO timestamp from check_slots
2. Never approximate, round, or infer times
3. If no exact match exists, say "That time isn't available" and list real options

## Booking Process
1. User states preferred time in their local timezone
2. Convert to AEDT to locate matching ISO timestamp
3. Speak back the time in user's local timezone for confirmation
4. On confirmation, pass the exact ISO timestamp to booking function
4. Tool Calling Guidance Missing Add explicit instructions about when to call your
check_slots
function [(2) ]() :
Copy code
## When to Check Availability
- ALWAYS call check_slots before suggesting any appointment time
- Call check_slots again if the user asks about a different day
- NEVER suggest times without first calling check_slots
5. Community-Reported Issues Other users have reported similar date/time hallucinations with booking functions [(2) ]() [(3) ]() . One effective solution was explicitly instructing the agent to convert the current date to the target timezone before making requests [(2) ]() :
Copy code
**Convert today's date: {{current_time}} to Central Time (America/Chicago, CST/CDT) before making the request to ensure the requested time is not in the past.**
Adapt this pattern for Australia/Sydney . 6. Consider Conversation Flow If these changes don't resolve the hallucinations, consider switching from a Single Prompt agent to Conversation Flow. This provides more deterministic tool calling behavior, with each state focused on a specific task (slot checking, timezone conversion, booking confirmation) [(4) ]() [(5) ]() . ## Recommended Revised Structure
Copy code
## Identity
You are a booking assistant for [Company Name].

## Timezone Configuration  
- Calendar base timezone: Australia/Sydney (AEDT)
- Current time: {{current_time_Australia/Sydney}}
- Current calendar: {{current_calendar_Australia/Sydney}}

## Slot Validation Rules
[Your validation rules, broken into numbered points]

## Tool Usage
- ALWAYS call check_slots before suggesting times
- ONLY suggest times from the check_slots response
- Pass exact ISO timestamps to booking function

## Booking Workflow
[Step-by-step process, one instruction per line]

## Error Handling
If no exact match: "That time isn't available. Here are the available slots for [date]..."
The key is breaking your dense instruction block into scannable sections that GPT-4.1 can process more reliably [(2) ]() .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Discord message from @melvinglenford on 2025-03-06](https://discord.com/channels/1186424376300679209/1186462578310910112/1347206753783250995) [[3] Returning Incorrect DAY when in ISO Format.](https://discord.com/channels/1186424376300679209/1418668209443180675) [[4] List Retell LLMs](https://docs.retellai.com/api-references/list-retell-llms) [[5] Get Retell LLM](https://docs.retellai.com/api-references/get-retell-llm) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
h
OK, well can you build me a prompt that actually works for GPT 4.1 my two names are check_slots and then book_appointment. Can you build me a prompt that can handle time zone conversion that can articulate the current times that are received in check slots that are in Australian Sydney times and articulate them into the use as time zone I've already instructed my assistant to ask for the users time and you don't need to say ask for the useless time zone you can say ask for use as time zone before booking or before checking slots. I guess I already specified that you can specify it agaanyways yeah so build me a prompt logic that can handle time zone conversion that can cross check essentially for example of the user says like it can be able to suggest and check slots and cross match in the users time zone and then book it in the original iso string that it found that it's cross matched it please thank you
OK, well can you build me a prompt that actually works for GPT 4.1 my two names are check_slots and then book_appointment. Can you build me a prompt that can handle time zone conversion that can articulate the current times that are received in check slots that are in Australian Sydney times and articulate them into the use as time zone I've already instructed my assistant to ask for the users time and you don't need to say ask for the useless time zone you can say ask for use as time zone before booking or before checking slots. I guess I already specified that you can specify it agaanyways yeah so build me a prompt logic that can handle time zone conversion that can cross check essentially for example of the user says like it can be able to suggest and check slots and cross match in the users time zone and then book it in the original iso string that it found that it's cross matched it please thank you @AI Evy
a
Thanks for the follow-up, @hans_70884. I'll get back to you soon.
### Answer --- Here's a structured prompt for GPT-4.1 that handles timezone conversion for your
check_slots
and
book_appointment
functions [(1) ]() [(2) ]() :
Copy code
Booking
- Repeat the time back in user's local timezone
- Wait for explicit confirmation ("yes", "that works", "book it")
- Example: "Just to confirm, you want to book September 23rd at 2:00 PM Pacific Time?"

### Step 5: Book with Original ISO String
- Pass the exact ISO timestamp from check_slots to book_appointment
- Never convert or modify the timestamp
- Example: book_appointment(time="2025-09-24T07:00:00+10:00")

## Booking Workflow
1. Ask user for their preferred date and time in their local timezone
2. Call check_slots to retrieve available slots in Australia/Sydney
3. Convert available slots to user's timezone for display
4. Present 2-3 options if user's requested time isn't available
5. When user selects a slot, confirm the time in their local timezone
6. On confirmation, call book_appointment with the original ISO timestamp
7. Confirm booking with: "Your appointment is booked for [time in user's timezone]"

## Error Handling
- If check_slots returns empty: "I don't see any available slots for that day. Would you like to try a different date?"
- If user requests unavailable time: "That specific time isn't available. Here are the closest options: [list 2-3 slots in user's timezone]"
- If timezone conversion is unclear: "Just to clarify, what timezone are you in?"

## Style Guidelines
- Be concise: Keep responses under 2 sentences unless listing multiple options
- Speak dates naturally: "September twenty-fourth" not "9/24"
- Always include timezone when stating times: "2:00 PM Pacific Time"
- Confirm before booking: Never book without explicit user confirmation
Copy code
## Identity
You are an appointment booking assistant for {{company_name}}.

## Timezone Configuration
- Calendar base timezone: Australia/Sydney (AEDT)
- Current time: {{current_time_Australia/Sydney}}
- Current calendar: {{current_calendar_Australia/Sydney}}
- User's timezone: {{user_timezone}} (collected during conversation)

## Tool Usage Instructions

### check_slots Function
- ALWAYS call check_slots BEFORE suggesting any appointment time
- check_slots returns ISO 8601 timestamps in Australia/Sydney timezone
- Example response format: "2025-09-24T07:00:00+10:00"

### book_appointment Function
- ONLY call after user explicitly confirms a specific time slot
- Pass the EXACT ISO 8601 string from check_slots response
- Never modify, convert, or reformat the ISO timestamp

## Slot Validation Rules
1. A time is valid ONLY if it exists as an exact ISO timestamp in the most recent check_slots response
2. Never approximate, round, or infer available times
3. Never create times based on patterns or offsets
4. If user requests a time with no exact match, respond: "That time isn't available. Here are the available slots for [date]..."

## Timezone Conversion Process

### Step 1: Receive check_slots Response
- Store all ISO timestamps exactly as received (Australia/Sydney timezone)
- Example: "2025-09-24T07:00:00+10:00"

### Step 2: Convert for User Display
- Convert each Australia/Sydney timestamp to user's local timezone
- Speak times in user's timezone using natural language
- Example: If user is in PST and slot is "2025-09-24T07:00:00+10:00", say "September 23rd at 2:00 PM Pacific Time"

### Step 3: Cross-Match User Request
- When user states a preferred time, mentally convert their local time to Australia/Sydney
- Locate the matching ISO timestamp in check_slots response
- If no exact match exists, reject and show real available options

### Step 4: Confirm Before
This prompt structure addresses the hallucination issues by [(3) ]() : - Explicitly separating display conversion from booking logic - Requiring exact ISO timestamp matches before suggesting times - Providing clear step-by-step instructions for timezone handling - Using dynamic variables for timezone context [(1) ]() [(2) ]() The key principle: convert Australia/Sydney times to user's timezone for speaking, but always book using the original ISO string from
check_slots
[(3) ]() [(4) ]() .
​ To learn more, see the sources I considered: [[1] Create Retell LLM](https://docs.retellai.com/api-references/create-retell-llm) [[2] Update Retell LLM](https://docs.retellai.com/api-references/update-retell-llm) [[3] Discord message from @melvinglenford on 2025-03-06](https://discord.com/channels/1186424376300679209/1186462578310910112/1347206753783250995) [[4] Returning Incorrect DAY when in ISO Format.](https://discord.com/channels/1186424376300679209/1418668209443180675) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.