From fcdeac792720dc055ab0d6031467e07f56d6355b Mon Sep 17 00:00:00 2001 From: Matthias Broecheler Date: Mon, 25 Nov 2024 18:08:17 -0800 Subject: [PATCH 1/2] updated configuration for new acorn --- finance-credit-card-chatbot/creditcard-rewards.graphqls | 8 ++++---- finance-credit-card-chatbot/creditcard-rewards.sqrl | 2 +- .../rewards-agent/creditcard.openai.config.json | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/finance-credit-card-chatbot/creditcard-rewards.graphqls b/finance-credit-card-chatbot/creditcard-rewards.graphqls index a054616b..fccac94a 100644 --- a/finance-credit-card-chatbot/creditcard-rewards.graphqls +++ b/finance-credit-card-chatbot/creditcard-rewards.graphqls @@ -60,7 +60,7 @@ type Query { """Retrieves User Chat Messages""" InternalGetChatMessages( - customerid: Int!, + userid: Int!, limit: Int = 10, offset: Int = 0 ): [CustomerChatMessage!] @@ -123,7 +123,7 @@ type CustomerChatMessage { content: String! name: String functionCall: String - customerid: Int! + userid: Int! timestamp: String! uuid: String! } @@ -138,9 +138,9 @@ input ChatMessageInput { content: String! name: String functionCall: String - customerid: Int + userid: Int } type CreatedChatMessage { - event_time: String! + _uuid: String! } \ No newline at end of file diff --git a/finance-credit-card-chatbot/creditcard-rewards.sqrl b/finance-credit-card-chatbot/creditcard-rewards.sqrl index 41b68d6f..8b059a79 100644 --- a/finance-credit-card-chatbot/creditcard-rewards.sqrl +++ b/finance-credit-card-chatbot/creditcard-rewards.sqrl @@ -65,7 +65,7 @@ PotentialRewardsByWeek := SELECT customerId, rewardCardType AS cardType, endOfWe /* Part 3: Integrate Chat Agent */ IMPORT creditcard-rewards.InternalSaveChatMessage; -InternalGetChatMessages := SELECT c.role, c.content, c.name, c.functionCall, c.customerid, c.event_time AS timestamp, +InternalGetChatMessages := SELECT c.role, c.content, c.name, c.functionCall, c.userid, c.event_time AS timestamp, c._uuid AS uuid FROM InternalSaveChatMessage c ORDER BY timestamp DESC; diff --git a/finance-credit-card-chatbot/rewards-agent/creditcard.openai.config.json b/finance-credit-card-chatbot/rewards-agent/creditcard.openai.config.json index 684cc624..3f7f5016 100644 --- a/finance-credit-card-chatbot/rewards-agent/creditcard.openai.config.json +++ b/finance-credit-card-chatbot/rewards-agent/creditcard.openai.config.json @@ -1,13 +1,13 @@ { "prompt": "You are a helpful customer service representative for Squirrel banking who helps answer customer about their credit card rewards. Squirrel banking offers 4 types of reward cards: travel, business, family, and sports. If a customer has one of those cards, you can help them lookup and analyze their rewards. In addition, you should try to sell the customer a rewards card by showing them how much they could have potentially earned with those cards. You recommend the card type that earns the customer the highest reward. You provide precise answers and look up all information using the provided functions. You DO NOT provide general answers and all data you present to the customer must be retrieved via functions. Today's date is June 4th, 2024. You answer in one of two ways: 1) in markdown syntax using tables where appropriate to show data or 2) by calling the `data_visualization` function to display the data in a suitable fashion. Whenever you are returning multiple data points, you should use option 2) and call the `data_visualization` function.", - "apis": { + "api": { "type": "graphql", - "url": "http://host.docker.internal:8888/graphql" + "url": "http://localhost:8888/graphql" }, + "history": true, "context": ["customerid"], - "client_functions": "datacharts", "model" : { "provider" : "openai", - "name": "gpt-4" + "name": "gpt-4o-mini" } } \ No newline at end of file From f22f23f32d69e580f7922396e3b15f8c09497021 Mon Sep 17 00:00:00 2001 From: Matthias Broecheler Date: Tue, 26 Nov 2024 09:39:39 -0800 Subject: [PATCH 2/2] Make userid a string in graphql --- finance-credit-card-chatbot/creditcard-rewards.graphqls | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/finance-credit-card-chatbot/creditcard-rewards.graphqls b/finance-credit-card-chatbot/creditcard-rewards.graphqls index fccac94a..ffebc695 100644 --- a/finance-credit-card-chatbot/creditcard-rewards.graphqls +++ b/finance-credit-card-chatbot/creditcard-rewards.graphqls @@ -60,7 +60,7 @@ type Query { """Retrieves User Chat Messages""" InternalGetChatMessages( - userid: Int!, + userid: String!, limit: Int = 10, offset: Int = 0 ): [CustomerChatMessage!] @@ -123,7 +123,7 @@ type CustomerChatMessage { content: String! name: String functionCall: String - userid: Int! + userid: String! timestamp: String! uuid: String! } @@ -138,7 +138,7 @@ input ChatMessageInput { content: String! name: String functionCall: String - userid: Int + userid: String! } type CreatedChatMessage {