mirror of
https://github.com/temporal-community/temporal-ai-agent.git
synced 2026-03-15 14:08:08 +01:00
prompt engineering with openai gpt 4o in mind
This commit is contained in:
@@ -18,7 +18,7 @@ goal_match_train_invoice = AgentGoal(
|
||||
"1. SearchFixtures: Search for fixtures for a team within a specified date range."
|
||||
"2. SearchTrains: Search for trains to the city of the match and list them for the customer to choose from"
|
||||
"3. BookTrains: Book the train tickets"
|
||||
"4. CreateInvoice: Proactively offer to create a simple invoice for the cost of the flights and train tickets",
|
||||
"4. CreateInvoice: Proactively offer to create a simple invoice for the cost the train tickets, inferred from the conversation history",
|
||||
starter_prompt="Welcome me, give me a description of what you can do, then ask me for the details you need to do your job",
|
||||
example_conversation_history="\n ".join(
|
||||
[
|
||||
@@ -38,7 +38,7 @@ goal_match_train_invoice = AgentGoal(
|
||||
"agent: Sounds good, let's book train tickets for the 11am outbound and 3:30pm return trains on May 9 and May 11, one day before and after the match.",
|
||||
"user_confirmed_tool_run: <user clicks confirm on BookTrains tool>",
|
||||
'tool_result: BookTrains responds in this JSON format and the results are parsed by the agent belowg [{"booking_reference": "BR10879","journey_id": "T9532,T1027","status": "confirmed"}]',
|
||||
"agent: Your train tickets have been booked. Would you like me to create an invoice now for the cost of the train tickets?",
|
||||
"agent: Your train tickets have been booked with the reference ABCD1234. Shall I create an invoice now for the cost of the train tickets?",
|
||||
"user: Sure",
|
||||
"user_confirmed_tool_run: <user clicks confirm on CreateInvoice tool which includes details of the train journey, the match, and the total cost>",
|
||||
'tool_result: CreateInvoice responds in this JSON format and the results are parsed by the agent below (including a link to the invoice): {"invoiceStatus": "open","invoiceURL": "https://invoice.stripe.com/i/acct_1NBOLuKVZbzw7QA5/test_YWNjdF8xTkJPTHVLVlpienc3UUE1LF9SbGJlZ2xLMjhlc3lxNzFkVVBXbkswOUlFa2Rna1RxLDEzMDAwMTY4Nw0200RLeJRMlw?s=ap","reference": "F9B01CD7-0001"}',
|
||||
@@ -89,7 +89,7 @@ goal_event_flight_invoice = AgentGoal(
|
||||
"agent: Great, lets book the train tickets",
|
||||
"user_confirmed_tool_run: <user clicks confirm on BookTrain tool>",
|
||||
'tool_result: results including {"status": "success"}',
|
||||
"agent: Train tickets booked! Now let's create an invoice for the flights and train tickets",
|
||||
"agent: Train tickets booked! Would you like me to create an invoice for the flights and train tickets?",
|
||||
"user_confirmed_tool_run: <user clicks confirm on CreateInvoice tool>",
|
||||
'tool_result: { "status": "success", "invoice": { "flight_number": "CX101", "amount": 850.0 }, invoiceURL: "https://example.com/invoice" }',
|
||||
"agent: Invoice generated! Here's the link: https://example.com/invoice",
|
||||
|
||||
@@ -68,24 +68,24 @@ book_trains_tool = ToolDefinition(
|
||||
|
||||
create_invoice_tool = ToolDefinition(
|
||||
name="CreateInvoice",
|
||||
description="Generate an invoice for the items described for the amount provided. Returns URL to invoice.",
|
||||
description="Generate an invoice for the items described for the total inferred by the conversation history so far. Returns URL to invoice.",
|
||||
arguments=[
|
||||
ToolArgument(
|
||||
name="amount",
|
||||
type="float",
|
||||
description="The total cost to be invoiced",
|
||||
description="The total cost to be invoiced. Infer this from the conversation history.",
|
||||
),
|
||||
ToolArgument(
|
||||
name="tripDetails",
|
||||
type="string",
|
||||
description="A description of the item details to be invoiced",
|
||||
description="A description of the item details to be invoiced, inferred from the conversation history.",
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
search_fixtures_tool = ToolDefinition(
|
||||
name="SearchFixtures",
|
||||
description="Search for upcoming fixtures for a given team within a specified date range. Valid teams this 24/25 season are Arsenal FC, Aston Villa FC, AFC Bournemouth, Brentford FC, Brighton & Hove Albion FC, Chelsea FC, Crystal Palace FC, Everton FC, Fulham FC, Ipswich Town FC, Leicester City FC, Liverpool FC, Manchester City FC, Manchester United FC, Newcastle United FC, Nottingham Forest FC, Southampton FC, Tottenham Hotspur FC, West Ham United FC, Wolverhampton Wanderers FC",
|
||||
description="Search for upcoming fixtures for a given team within a date range inferred from the user's description. Valid teams this 24/25 season are Arsenal FC, Aston Villa FC, AFC Bournemouth, Brentford FC, Brighton & Hove Albion FC, Chelsea FC, Crystal Palace FC, Everton FC, Fulham FC, Ipswich Town FC, Leicester City FC, Liverpool FC, Manchester City FC, Manchester United FC, Newcastle United FC, Nottingham Forest FC, Southampton FC, Tottenham Hotspur FC, West Ham United FC, Wolverhampton Wanderers FC",
|
||||
arguments=[
|
||||
ToolArgument(
|
||||
name="team",
|
||||
@@ -95,12 +95,12 @@ search_fixtures_tool = ToolDefinition(
|
||||
ToolArgument(
|
||||
name="start_date",
|
||||
type="string",
|
||||
description="The start date (YYYY-MM-DD) for the fixture search.",
|
||||
description="The start date in format (YYYY-MM-DD) for the fixture search inferred from the user's request (e.g. mid-March).",
|
||||
),
|
||||
ToolArgument(
|
||||
name="end_date",
|
||||
type="string",
|
||||
description="The end date (YYYY-MM-DD) for the fixture search.",
|
||||
description="The end date in format (YYYY-MM-DD) for the fixture search (e.g. 'the last week of May').",
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user