From ecb7822a07df2097c402babd838e5c78ef445ccc Mon Sep 17 00:00:00 2001 From: Alfred Nutile Date: Mon, 5 Aug 2024 20:10:25 -0400 Subject: [PATCH 1/5] ui updates --- Modules/LlmDriver/app/ClaudeClient.php | 3 +- app/Domains/Messages/RoleEnum.php | 1 + app/Domains/Prompts/SummarizePrompt.php | 1 - app/Models/Message.php | 5 +- resources/js/Pages/Chat/Chatv2.vue | 299 ++++++++++++++---------- resources/js/Pages/Collection/Index.vue | 2 + tests/fixtures/claude_payload_chat.json | 36 +++ 7 files changed, 220 insertions(+), 127 deletions(-) create mode 100644 tests/fixtures/claude_payload_chat.json diff --git a/Modules/LlmDriver/app/ClaudeClient.php b/Modules/LlmDriver/app/ClaudeClient.php index 98d48712..98e47144 100644 --- a/Modules/LlmDriver/app/ClaudeClient.php +++ b/Modules/LlmDriver/app/ClaudeClient.php @@ -54,6 +54,8 @@ public function chat(array $messages): CompletionResponse $payload = $this->modifyPayload($payload); + put_fixture('claude_payload_chat.json', $payload); + $results = $this->getClient()->post('/messages', $payload); if (! $results->ok()) { @@ -303,7 +305,6 @@ public function functionPromptChat(array $messages, array $only = []): array $results = $this->getClient()->post('/messages', [ 'model' => $model, - 'system' => 'Return a markdown response.', 'max_tokens' => $maxTokens, 'messages' => $messages, 'tools' => $this->getFunctions(), diff --git a/app/Domains/Messages/RoleEnum.php b/app/Domains/Messages/RoleEnum.php index becb1a25..caa45856 100644 --- a/app/Domains/Messages/RoleEnum.php +++ b/app/Domains/Messages/RoleEnum.php @@ -7,4 +7,5 @@ enum RoleEnum: string case User = 'user'; case System = 'system'; case Assistant = 'assistant'; + case Tool = 'tool'; } diff --git a/app/Domains/Prompts/SummarizePrompt.php b/app/Domains/Prompts/SummarizePrompt.php index 43c05d40..e0a4b16a 100644 --- a/app/Domains/Prompts/SummarizePrompt.php +++ b/app/Domains/Prompts/SummarizePrompt.php @@ -18,7 +18,6 @@ public static function prompt(string $originalPrompt, string $context): string **Format** Deliver the response in a concise, clear Markdown format (Text). Use quotes as needed from the context. -[DO NOT INCLUDE THE ABOVE IN THE RESPONSE] **The User's Query**: ```$originalPrompt``` diff --git a/app/Models/Message.php b/app/Models/Message.php index c04c7928..10391ce4 100644 --- a/app/Models/Message.php +++ b/app/Models/Message.php @@ -223,11 +223,12 @@ public function run(): void $meta_data->driver = $chat->getDriver(); $message->updateQuietly(['meta_data' => $meta_data]); - if ($message->meta_data?->tool === 'completion') { + if ($message->meta_data?->tool === 'chat') { Log::info('[LaraChain] Running Simple Completion'); $messages = $chat->getChatResponse(); - $response = LlmDriverFacade::driver($chat->getDriver())->chat($messages); + $response = LlmDriverFacade::driver($chat->getDriver()) + ->chat($messages); $response = $response->content; $chat->addInput( diff --git a/resources/js/Pages/Chat/Chatv2.vue b/resources/js/Pages/Chat/Chatv2.vue index d51db011..bea9e734 100644 --- a/resources/js/Pages/Chat/Chatv2.vue +++ b/resources/js/Pages/Chat/Chatv2.vue @@ -9,7 +9,7 @@ const toast = useToast(); import ChatMessageV2 from "@/Pages/Chat/ChatMessageV2.vue"; import DisplayMenu from "@/Components/DisplayMenu.vue"; - +import {Switch, SwitchGroup, SwitchLabel} from '@headlessui/vue' const props = defineProps({ loading: { type: Boolean, @@ -41,6 +41,12 @@ const dateRangeChosen = ref({}); const referenceCollectionChosen = ref({}); +const chatOnly = ref(false); + +watch(chatOnly, () => { + form.tool = chatOnly.value ? 'chat' : ''; +}) + const dateRangeSelected = (dateRange) => { dateRangeChosen.value = dateRange; form.date_range = dateRange?.id @@ -137,14 +143,14 @@ const save = () => { persona: persona, filter: filter }).then(response => { - getLatestMessage(false); - form.input = ""; - }) + getLatestMessage(false); + form.input = ""; + }) .catch(error => { - getting_results.value = false - toast.error('An error occurred. Please try again.') - console.log(error) - }); + getting_results.value = false + toast.error('An error occurred. Please try again.') + console.log(error) + }); } const setQuestion = (question) => { @@ -223,29 +229,62 @@ const rerun = (message) => {
-
- -
+
+ +
-
-
+ diff --git a/tests/fixtures/claude_payload_chat.json b/tests/fixtures/claude_payload_chat.json new file mode 100644 index 00000000..68c98858 --- /dev/null +++ b/tests/fixtures/claude_payload_chat.json @@ -0,0 +1,36 @@ +{ + "model": "claude-3-5-sonnet-20240620", + "system": "Return a markdown response.", + "max_tokens": 4096, + "messages": [ + { + "content": "list out all events by month", + "role": "user" + }, + { + "content": "**Role**\nA Summarization and Prompt Answering system that sticks to the context in this prompt.\n**Task**\nUsing the context of the prompt and the users query return a concise, clear, and accurate response.\n**Format**\nDeliver the response in a concise, clear Markdown format (Text). Use quotes as needed from the context.\n\n\n**The User's Query**:\n```list out all events by month```\n\n**Context from the database search of documents for Response**:\n```![](data:image\/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSI5OTk5OXB4IiBoZWlnaHQ9Ijk5OTk5cHgiIHZpZXdCb3g9IjAgMCA5OTk5OSA5OTk5OSIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48ZyBzdHJva2U9Im5vbmUiIGZpbGw9Im5vbmUiIGZpbGwtb3BhY2l0eT0iMCI+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9Ijk5OTk5IiBoZWlnaHQ9Ijk5OTk5Ij48L3JlY3Q+IDwvZz4gPC9zdmc+)\n\nSkip to main contentSkip to navigation\n\nTop EventsMLBWNBAPGA TourLPGA TourTop SoccerNBA Summer LeagueTennis (W)Tennis (M)UFCF1NASCARNFLNCAAFNCAAMNCAAWPLL (Lacr A TourLPGA TourTop SoccerNBA Summer LeagueTennis (W)Tennis (M)UFCF1NASCARNFLNCAAFNCAAMNCAAWPLL (Lacrosse)NBANHLOLY Basketball (W)OLY Basketball (M)OLY Soccer (W)OLY Soccer (M)OLY Golf (M)OLY Golf (W)OLY Athletics (M)OLY Athletics (W)OLY Swimming (M)OLY Swimming (W)OLY Tennis (M)OLY Tennis (W)NBA\n\nJun 12Jun 14Jun 17Jun 17\n\n[Gamecast](\/nba\/game\/_\/gameId\/401656363\/mavericks-celtics)\n[Box Score](\/nba\/boxscore\/_\/gameId\/401656363)\n\n[* DAL\\\n \\\n 88\\\n \\\n* BOS\\\n \\\n 106](\/nba\/game\/_\/gameId\/401656363\/mavericks-celtics)\n\nFinal\n\n[Full Scoreboard ](\/nba\/scoreboard)\n\n[ESPN](\/)\n\n* [NFL]( ![](data:image\/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSI5OTk5OXB4IiBoZWlnaHQ9Ijk5OTk5cHgiIHZpZXdCb3g9IjAgMCA5OTk5OSA5OTk5OSIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48ZyBzdHJva2U9Im5vbmUiIGZpbGw9Im5vbmUiIGZpbGwtb3BhY2l0eT0iMCI+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9Ijk5OTk5IiBoZWlnaHQ9Ijk5OTk5Ij48L3JlY3Q+IDwvZz4gPC9zdmc+)\n\nSkip to main contentSkip to navigation\n\nTop EventsMLBWNBAPGA TourLPGA TourTop SoccerNBA Summer LeagueTennis (W)Tennis (M)UFCF1NASCARNFLNCAAFNCAAMNCAAWPLL (Lacr A TourLPGA TourTop SoccerNBA Summer LeagueTennis (W)Tennis (M)UFCF1NASCARNFLNCAAFNCAAMNCAAWPLL (Lacrosse)NBANHLOLY Basketball (W)OLY Basketball (M)OLY Soccer (W)OLY Soccer (M)OLY Golf (M)OLY Golf (W)OLY Athletics (M)OLY Athletics (W)OLY Swimming (M)OLY Swimming (W)OLY Tennis (M)OLY Tennis (W)NBA\n\nJun 12Jun 14Jun 17Jun 17\n\n[Gamecast](\/nba\/game\/_\/gameId\/401656363\/mavericks-celtics)\n[Box Score](\/nba\/boxscore\/_\/gameId\/401656363)\n\n[* DAL\\\n \\\n 88\\\n \\\n* BOS\\\n \\\n 106](\/nba\/game\/_\/gameId\/401656363\/mavericks-celtics)\n\nFinal\n\n[Full Scoreboard ](\/nba\/scoreboard)\n\n[ESPN](\/)\n\n* [NFL]( Id\/401656363\/mavericks-celtics)\n\nFinal\n\n[Full Scoreboard ](\/nba\/scoreboard)\n\n[ESPN](\/)\n\n* [NFL](\/nfl\/)\n NFL\n\n* [NBA](\/nba\/)\n NBA\n\n* [MLB](\/mlb\/)\n MLB\n\n* [Olympics](\/olympics\/)\n Olympics\n\n* [Soccer](\/soccer\/)\n Soccer\n\n* [WNBA](\/wnba\/)\n WNBA\n\n* [More Sports](http:\/\/www.espn.com)\n More Sports\n\n* [](\/espnplus\/?om-navmethod=topnav)\n ESPN Plus\n\n* [](https:\/\/espnbet.app.link\/V424mquT4Eb?$3p=a_espn)\n ESPN BET\n\n* [Watch](http:\/\/www.espn.com\/watch\/)\n Watch\n\n* [Fantasy](\/fantasy\/)\n Fantasy\n\n* [More ESPN](http:\/\/www.espn.com)\n More ESPN\n\n* Se A TourLPGA TourTop SoccerNBA Summer LeagueTennis (W)Tennis (M)UFCF1NASCARNFLNCAAFNCAAMNCAAWPLL (Lacrosse)NBANHLOLY Basketball (W)OLY Basketball (M)OLY Soccer (W)OLY Soccer (M)OLY Golf (M)OLY Golf (W)OLY Athletics (M)OLY Athletics (W)OLY Swimming (M)OLY Swimming (W)OLY Tennis (M)OLY Tennis (W)NBA\n\nJun 12Jun 14Jun 17Jun 17\n\n[Gamecast](\/nba\/game\/_\/gameId\/401656363\/mavericks-celtics)\n[Box Score](\/nba\/boxscore\/_\/gameId\/401656363)\n\n[* DAL\\\n \\\n 88\\\n \\\n* BOS\\\n \\\n 106](\/nba\/game\/_\/gameId\/401656363\/mavericks-celtics)\n\nFinal\n\n[Full Scoreboard ](\/nba\/scoreboard)\n\n[ESPN](\/)\n\n* [NFL]( Id\/401656363\/mavericks-celtics)\n\nFinal\n\n[Full Scoreboard ](\/nba\/scoreboard)\n\n[ESPN](\/)\n\n* [NFL](\/nfl\/)\n NFL\n\n* [NBA](\/nba\/)\n NBA\n\n* [MLB](\/mlb\/)\n MLB\n\n* [Olympics](\/olympics\/)\n Olympics\n\n* [Soccer](\/soccer\/)\n Soccer\n\n* [WNBA](\/wnba\/)\n WNBA\n\n* [More Sports](http:\/\/www.espn.com)\n More Sports\n\n* [](\/espnplus\/?om-navmethod=topnav)\n ESPN Plus\n\n* [](https:\/\/espnbet.app.link\/V424mquT4Eb?$3p=a_espn)\n ESPN BET\n\n* [Watch](http:\/\/www.espn.com\/watch\/)\n Watch\n\n* [Fantasy](\/fantasy\/)\n Fantasy\n\n* [More ESPN](http:\/\/www.espn.com)\n More ESPN\n\n* Se ch\n\n* [Fantasy](\/fantasy\/)\n Fantasy\n\n* [More ESPN](http:\/\/www.espn.com)\n More ESPN\n\n* Search\n \n\n* Profile Management\n\nDetroitPistons\n==============\n\nFollow\n\n* 14-68\n* 5th in Central Division\n\n* [](\/nba\/team\/_\/name\/det\/detroit-pistons)\n \n\n* [Home](\/nba\/team\/_\/name\/det\/detroit-pistons)\n \n\n* [Stats](\/nba\/team\/stats\/_\/name\/det\/detroit-pistons)\n \n\n* [Schedule](\/nba\/team\/schedule\/_\/name\/det\/detroit-pistons)\n \n\n* [Roster](\/nba\/team\/roster\/_\/name\/det\/detroit-pistons)\n \n\n* [Depth](\/nba\/team\/depth\/_\/name\/det\/detroit-pistons)\n \n\n* [Injuries](\/nba\/team\/ Id\/401656363\/mavericks-celtics)\n\nFinal\n\n[Full Scoreboard ](\/nba\/scoreboard)\n\n[ESPN](\/)\n\n* [NFL](\/nfl\/)\n NFL\n\n* [NBA](\/nba\/)\n NBA\n\n* [MLB](\/mlb\/)\n MLB\n\n* [Olympics](\/olympics\/)\n Olympics\n\n* [Soccer](\/soccer\/)\n Soccer\n\n* [WNBA](\/wnba\/)\n WNBA\n\n* [More Sports](http:\/\/www.espn.com)\n More Sports\n\n* [](\/espnplus\/?om-navmethod=topnav)\n ESPN Plus\n\n* [](https:\/\/espnbet.app.link\/V424mquT4Eb?$3p=a_espn)\n ESPN BET\n\n* [Watch](http:\/\/www.espn.com\/watch\/)\n Watch\n\n* [Fantasy](\/fantasy\/)\n Fantasy\n\n* [More ESPN](http:\/\/www.espn.com)\n More ESPN\n\n* Se ch\n\n* [Fantasy](\/fantasy\/)\n Fantasy\n\n* [More ESPN](http:\/\/www.espn.com)\n More ESPN\n\n* Search\n \n\n* Profile Management\n\nDetroitPistons\n==============\n\nFollow\n\n* 14-68\n* 5th in Central Division\n\n* [](\/nba\/team\/_\/name\/det\/detroit-pistons)\n \n\n* [Home](\/nba\/team\/_\/name\/det\/detroit-pistons)\n \n\n* [Stats](\/nba\/team\/stats\/_\/name\/det\/detroit-pistons)\n \n\n* [Schedule](\/nba\/team\/schedule\/_\/name\/det\/detroit-pistons)\n \n\n* [Roster](\/nba\/team\/roster\/_\/name\/det\/detroit-pistons)\n \n\n* [Depth](\/nba\/team\/depth\/_\/name\/det\/detroit-pistons)\n \n\n* [Injuries](\/nba\/team\/ stons)\n \n\n* [Depth](\/nba\/team\/depth\/_\/name\/det\/detroit-pistons)\n \n\n* [Injuries](\/nba\/team\/injuries\/_\/name\/det\/detroit-pistons)\n \n\n* [Transactions](\/nba\/team\/transactions\/_\/name\/det\/detroit-pistons)\n \n\n* [TicketsExternal Link](https:\/\/www.vividseats.com\/nba\/detroit-pistons-tickets.html?wsUser=717&wsVar=us~nba~team,nba,desktop,en)\n \n\nDetroit Pistons Schedule 2023-24\n================================\n\nMore NBA TeamsAtlanta HawksBoston CelticsBrooklyn NetsCharlotte HornetsChicago BullsCleveland CavaliersDallas MavericksDenver NuggetsGolden State WarriorsHouston RocketsIndiana ch\n\n* [Fantasy](\/fantasy\/)\n Fantasy\n\n* [More ESPN](http:\/\/www.espn.com)\n More ESPN\n\n* Search\n \n\n* Profile Management\n\nDetroitPistons\n==============\n\nFollow\n\n* 14-68\n* 5th in Central Division\n\n* [](\/nba\/team\/_\/name\/det\/detroit-pistons)\n \n\n* [Home](\/nba\/team\/_\/name\/det\/detroit-pistons)\n \n\n* [Stats](\/nba\/team\/stats\/_\/name\/det\/detroit-pistons)\n \n\n* [Schedule](\/nba\/team\/schedule\/_\/name\/det\/detroit-pistons)\n \n\n* [Roster](\/nba\/team\/roster\/_\/name\/det\/detroit-pistons)\n \n\n* [Depth](\/nba\/team\/depth\/_\/name\/det\/detroit-pistons)\n \n\n* [Injuries](\/nba\/team\/ stons)\n \n\n* [Depth](\/nba\/team\/depth\/_\/name\/det\/detroit-pistons)\n \n\n* [Injuries](\/nba\/team\/injuries\/_\/name\/det\/detroit-pistons)\n \n\n* [Transactions](\/nba\/team\/transactions\/_\/name\/det\/detroit-pistons)\n \n\n* [TicketsExternal Link](https:\/\/www.vividseats.com\/nba\/detroit-pistons-tickets.html?wsUser=717&wsVar=us~nba~team,nba,desktop,en)\n \n\nDetroit Pistons Schedule 2023-24\n================================\n\nMore NBA TeamsAtlanta HawksBoston CelticsBrooklyn NetsCharlotte HornetsChicago BullsCleveland CavaliersDallas MavericksDenver NuggetsGolden State WarriorsHouston RocketsIndiana go BullsCleveland CavaliersDallas MavericksDenver NuggetsGolden State WarriorsHouston RocketsIndiana PacersLA ClippersLos Angeles LakersMemphis GrizzliesMiami HeatMilwaukee BucksMinnesota TimberwolvesNew Orleans PelicansNew York KnicksOklahoma City ThunderOrlando MagicPhiladelphia 76ersPhoenix SunsPortland Trail BlazersSacramento KingsSan Antonio SpursToronto RaptorsUtah JazzWashington WizardsMore NBA Teams\n\n2024-252023-242022-232021-222020-212019-202018-192017-182016-172015-162014-152013-142012-132011-122010-112009-102008-092007-082006-072005-062004-052003-042002-032023-24\n\nPreseasonRegular S stons)\n \n\n* [Depth](\/nba\/team\/depth\/_\/name\/det\/detroit-pistons)\n \n\n* [Injuries](\/nba\/team\/injuries\/_\/name\/det\/detroit-pistons)\n \n\n* [Transactions](\/nba\/team\/transactions\/_\/name\/det\/detroit-pistons)\n \n\n* [TicketsExternal Link](https:\/\/www.vividseats.com\/nba\/detroit-pistons-tickets.html?wsUser=717&wsVar=us~nba~team,nba,desktop,en)\n \n\nDetroit Pistons Schedule 2023-24\n================================\n\nMore NBA TeamsAtlanta HawksBoston CelticsBrooklyn NetsCharlotte HornetsChicago BullsCleveland CavaliersDallas MavericksDenver NuggetsGolden State WarriorsHouston RocketsIndiana go BullsCleveland CavaliersDallas MavericksDenver NuggetsGolden State WarriorsHouston RocketsIndiana PacersLA ClippersLos Angeles LakersMemphis GrizzliesMiami HeatMilwaukee BucksMinnesota TimberwolvesNew Orleans PelicansNew York KnicksOklahoma City ThunderOrlando MagicPhiladelphia 76ersPhoenix SunsPortland Trail BlazersSacramento KingsSan Antonio SpursToronto RaptorsUtah JazzWashington WizardsMore NBA Teams\n\n2024-252023-242022-232021-222020-212019-202018-192017-182016-172015-162014-152013-142012-132011-122010-112009-102008-092007-082006-072005-062004-052003-042002-032023-24\n\nPreseasonRegular S -132011-122010-112009-102008-092007-082006-072005-062004-052003-042002-032023-24\n\nPreseasonRegular SeasonRegular Season\n\n| | | | | | | |\n| --- | --- | --- | --- | --- | --- | --- |\n| DATE | OPPONENT | RESULT | W-L | Hi Points | Hi Rebounds | Hi Assists |\n| Wed, Oct 25 | @ [](\/nba\/team\/_\/name\/mia\/miami-heat)[Miami](\/nba\/team\/_\/name\/mia\/miami-heat) | L[103-102](https:\/\/www.espn.com\/nba\/game\/_\/gameId\/401584696\/pistons-heat) | 0-1 | [Cunningham](https:\/\/www.espn.com\/nba\/player\/_\/id\/4432166\/cade-cunningham)
30 | [Duren](https:\/\/www.espn.com\/nba\/player\/_\/id\/4433621\/ja go BullsCleveland CavaliersDallas MavericksDenver NuggetsGolden State WarriorsHouston RocketsIndiana PacersLA ClippersLos Angeles LakersMemphis GrizzliesMiami HeatMilwaukee BucksMinnesota TimberwolvesNew Orleans PelicansNew York KnicksOklahoma City ThunderOrlando MagicPhiladelphia 76ersPhoenix SunsPortland Trail BlazersSacramento KingsSan Antonio SpursToronto RaptorsUtah JazzWashington WizardsMore NBA Teams\n\n2024-252023-242022-232021-222020-212019-202018-192017-182016-172015-162014-152013-142012-132011-122010-112009-102008-092007-082006-072005-062004-052003-042002-032023-24\n\nPreseasonRegular S -132011-122010-112009-102008-092007-082006-072005-062004-052003-042002-032023-24\n\nPreseasonRegular SeasonRegular Season\n\n| | | | | | | |\n| --- | --- | --- | --- | --- | --- | --- |\n| DATE | OPPONENT | RESULT | W-L | Hi Points | Hi Rebounds | Hi Assists |\n| Wed, Oct 25 | @ [](\/nba\/team\/_\/name\/mia\/miami-heat)[Miami](\/nba\/team\/_\/name\/mia\/miami-heat) | L[103-102](https:\/\/www.espn.com\/nba\/game\/_\/gameId\/401584696\/pistons-heat) | 0-1 | [Cunningham](https:\/\/www.espn.com\/nba\/player\/_\/id\/4432166\/cade-cunningham)
30 | [Duren](https:\/\/www.espn.com\/nba\/player\/_\/id\/4433621\/ja layer\/_\/id\/4432166\/cade-cunningham)
30 | [Duren](https:\/\/www.espn.com\/nba\/player\/_\/id\/4433621\/jalen-duren)
14 | [Cunningham](https:\/\/www.espn.com\/nba\/player\/_\/id\/4432166\/cade-cunningham)
9 |\n| Fri, Oct 27 | @ [](\/nba\/team\/_\/name\/cha\/charlotte-hornets)[Charlotte](\/nba\/team\/_\/name\/cha\/charlotte-hornets) | W[111-99](https:\/\/www.espn.com\/nba\/game\/_\/gameId\/401584705\/pistons-hornets) | 1-1 | [Burks](https:\/\/www.espn.com\/nba\/player\/_\/id\/6429\/alec-burks)
24 | [Duren](https:\/\/www.espn.com\/nba\/player\/_\/id\/4433621\/jalen-duren)
17 | [Cunningham](https:\/\/www.espn.com\/nba\/player\/_\/id\/443 -132011-122010-112009-102008-092007-082006-072005-062004-052003-042002-032023-24\n\nPreseasonRegular SeasonRegular Season\n\n| | | | | | | |\n| --- | --- | --- | --- | --- | --- | --- |\n| DATE | OPPONENT | RESULT | W-L | Hi Points | Hi Rebounds | Hi Assists |\n| Wed, Oct 25 | @ [](\/nba\/team\/_\/name\/mia\/miami-heat)[Miami](\/nba\/team\/_\/name\/mia\/miami-heat) | L[103-102](https:\/\/www.espn.com\/nba\/game\/_\/gameId\/401584696\/pistons-heat) | 0-1 | [Cunningham](https:\/\/www.espn.com\/nba\/player\/_\/id\/4432166\/cade-cunningham)
30 | [Duren](https:\/\/www.espn.com\/nba\/player\/_\/id\/4433621\/ja layer\/_\/id\/4432166\/cade-cunningham)
30 | [Duren](https:\/\/www.espn.com\/nba\/player\/_\/id\/4433621\/jalen-duren)
14 | [Cunningham](https:\/\/www.espn.com\/nba\/player\/_\/id\/4432166\/cade-cunningham)
9 |\n| Fri, Oct 27 | @ [](\/nba\/team\/_\/name\/cha\/charlotte-hornets)[Charlotte](\/nba\/team\/_\/name\/cha\/charlotte-hornets) | W[111-99](https:\/\/www.espn.com\/nba\/game\/_\/gameId\/401584705\/pistons-hornets) | 1-1 | [Burks](https:\/\/www.espn.com\/nba\/player\/_\/id\/6429\/alec-burks)
24 | [Duren](https:\/\/www.espn.com\/nba\/player\/_\/id\/4433621\/jalen-duren)
17 | [Cunningham](https:\/\/www.espn.com\/nba\/player\/_\/id\/443 \/nba\/player\/_\/id\/4433621\/jalen-duren)
17 | [Cunningham](https:\/\/www.espn.com\/nba\/player\/_\/id\/4432166\/cade-cunningham)
6 |\n| Sat, Oct 28 | vs [](\/nba\/team\/_\/name\/chi\/chicago-bulls)[Chicago](\/nba\/team\/_\/name\/chi\/chicago-bulls) | W[118-102](https:\/\/www.espn.com\/nba\/game\/_\/gameId\/401584716\/bulls-pistons) | 2-1 | [Cunningham](https:\/\/www.espn.com\/nba\/player\/_\/id\/4432166\/cade-cunningham)
25 | [Duren](https:\/\/www.espn.com\/nba\/player\/_\/id\/4433621\/jalen-duren)
15 | [Cunningham](https:\/\/www.espn.com\/nba\/player\/_\/id\/4432166\/cade-cunningham)
10 |\n| Tue, Oct 31 | @ [](\/nba\/team\/_\/name\/o```", + "role": "assistant" + }, + { + "role": "user", + "content": "Using the surrounding context to continue this response thread" + }, + { + "content": "**Response**:\nHere is a list of the Detroit Pistons' events by month for the 2023-24 season, based on the schedule information provided:\n\nOctober 2023:\n- Oct 25: @ Miami Heat (L 103-102)\n- Oct 27: @ Charlotte Hornets (W 111-99)\n- Oct 28: vs Chicago Bulls (W 118-102)\n- Oct 31: @ Oklahoma City Thunder (result not shown)\n\nThe schedule information only covers games through October 31st. To provide a full list of events by month for the entire season, more schedule data would be needed for the remaining months (November through April).", + "role": "assistant" + }, + { + "content": "summarize this collection grouping events by \nEvent Start\nEvent Title", + "role": "user" + }, + { + "content": "Here's a summary of the Detroit Pistons 2023-24 schedule grouped by Event Start and Event Title:\n\nOctober 2023:\n- Oct 25: @ Miami Heat (L 103-102)\n- Oct 27: @ Charlotte Hornets (W 111-99)\n- Oct 28: vs Chicago Bulls (W 118-102)\n- Oct 31: @ Oklahoma City Thunder (L 124-112)\n\nNovember 2023:\n- Nov 1: vs Portland Trail Blazers (L 110-101)\n- Nov 3: @ New Orleans Pelicans (L 125-116)\n- Nov 5: vs Phoenix Suns (L 120-106)\n- Nov 7: vs Golden State Warriors (L 120-109)\n- Nov 9: @ Milwaukee Bucks (L 120-118)\n- Nov 11: vs Philadelphia 76ers (L 114-106)\n- Nov 13: @ Chicago Bulls (L 119-108)\n- Nov 15: vs Atlanta Hawks (L 126-120)\n- Nov 18: @ Cleveland Cavaliers (L 108-100)\n- Nov 19: @ Toronto Raptors (L 142-113)\n- Nov 21: vs Denver Nuggets (L 107-103)\n- Nov 25: @ Indiana Pacers (L 136-113)\n- Nov 28: vs Washington Wizards (L 126-107)\n- Nov 30: vs Los Angeles Lakers (L 133-107)\n\nDecember 2023:\n- Dec 1: @ New York Knicks (L 118-112)\n- Dec 3: vs Cleveland Cavaliers (L 110-101)\n- Dec 7: vs Memphis Grizzlies (L 116-102)\n- Dec 9: @ Orlando Magic (L 123-91)\n- Dec 12: vs Indiana Pacers (L 131-123)\n- Dec 14: vs Philadelphia 76ers (L 129-111)\n- Dec 16: @ Philadelphia 76ers (L 124-92)\n- Dec 16: @ Milwaukee Bucks (L 146-114)\n- Dec 19: @ Atlanta Hawks (L 130-124)\n- Dec 22: vs Utah Jazz (L 119-111)\n- Dec 24: @ Brooklyn Nets (L 126-115)\n- Dec 27: vs Brooklyn Nets (L 118-112)\n- Dec 29: @ Boston Celtics (L 128-122 OT)\n- Dec 30: vs Toronto Raptors (W 129-127)\n\nJanuary 2024:\n- Jan 2: @ Houston Rockets (L 136-113)\n- Jan 4: @ Utah Jazz (L 154-148 OT)\n- Jan 6: @ Golden State Warriors (L 113-109)\n- Jan 8: @ Denver Nuggets (L 131-114)\n- Jan 10: vs Sacramento Kings (L 131-110)\n- Jan 11: vs San Antonio Spurs (L 130-108)\n- Jan 13: vs Houston Rockets (L 112-110)\n- Jan 15: @ Washington Wizards (W 129-117)\n- Jan 18: vs Minnesota Timberwolves (L 124-117)\n- Jan 20: vs Milwaukee Bucks (L 141-135)\n- Jan 23: vs Milwaukee Bucks (L 122-113)\n- Jan 25: vs Charlotte Hornets (W 113-106)\n- Jan 27: vs Washington Wizards (L 118-104)\n- Jan 28: vs Oklahoma City Thunder (W 120-104)\n\nFebruary 2024:\n- Feb 1: @ Cleveland Cavaliers (L 128-121)\n- Feb 3: vs LA Clippers (L 136-125)\n- Feb 4: vs Orlando Magic (L 111-99)\n- Feb 8: @ Sacramento Kings (W 133-120)\n- Feb 9: @ Portland Trail Blazers (W 128-122 OT)\n- Feb 10: @ LA Clippers (L 112-106)\n- Feb 14: @ Los Angeles Lakers (L 125-111)\n- Feb 15: @ Phoenix Suns (L 116-100)\n- Feb 23: @ Indiana Pacers (L 129-115)\n- Feb 25: vs Orlando Magic (L 112-109)\n- Feb 27: @ New York Knicks (L 113-111)\n- Feb 28: @ Chicago Bulls (W 105-95)\n\nMarch 2024:\n- Mar 2: vs Cleveland Cavaliers (L 110-100)\n- Mar 3: @ Orlando Magic (L 113-91)\n- Mar 6: @ Miami Heat (L 118-110)\n- Mar 8: vs Brooklyn Nets (W 118-112)\n- Mar 10: vs Dallas Mavericks (L 142-124)\n- Mar 11: vs Charlotte Hornets (W 114-97)\n- Mar 13: vs Toronto Raptors (W 113-104)\n- Mar 15: vs Miami Heat (L 108-95)\n- Mar 17: vs Miami Heat (L 104-101)\n- Mar 18: @ Boston Celtics (L 119-94)\n- Mar 20: vs Indiana Pacers (L 122-103)\n- Mar 22: vs Boston Celtics (L 129-102)\n- Mar 24: vs New Orleans Pelicans (L 114-101)\n- Mar 25: @ New York Knicks (L 124-99)\n- Mar 28: @ Minnesota Timberwolves (L 106-91)\n- Mar 29: @ Washington Wizards (W 96-87)\n\nApril 2024:\n- Apr 1: vs Memphis Grizzlies (L 110-108)\n- Apr 3: @ Atlanta Hawks (L 121-113)\n- Apr 6: @ Memphis Grizzlies (L 108-90)\n- Apr 6: @ Brooklyn Nets (L 113-103)\n- Apr 9: @ Philadelphia 76ers (L 120-102)\n- Apr 11: vs Chicago Bulls (L 127-105)\n- Apr 13: @ Dallas Mavericks (W 107-89)\n- Apr 14: @ San Antonio Spurs (L 123-95)", + "role": "assistant" + }, + { + "content": "what goes on in March", + "role": "user" + } + ], + "tools": [] +} \ No newline at end of file From b43305739d9fa96b65856637cc61d95cbddfbb84 Mon Sep 17 00:00:00 2001 From: Alfred Nutile Date: Mon, 5 Aug 2024 20:20:24 -0400 Subject: [PATCH 2/5] add the scroll down ui --- resources/js/Components/ScrollButton.vue | 22 ++++++++++++++++++++++ resources/js/Pages/Chat/Chatv2.vue | 13 ++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 resources/js/Components/ScrollButton.vue diff --git a/resources/js/Components/ScrollButton.vue b/resources/js/Components/ScrollButton.vue new file mode 100644 index 00000000..f7ed7ecb --- /dev/null +++ b/resources/js/Components/ScrollButton.vue @@ -0,0 +1,22 @@ + + + diff --git a/resources/js/Pages/Chat/Chatv2.vue b/resources/js/Pages/Chat/Chatv2.vue index bea9e734..840af54e 100644 --- a/resources/js/Pages/Chat/Chatv2.vue +++ b/resources/js/Pages/Chat/Chatv2.vue @@ -7,6 +7,8 @@ import Filters from "@/Pages/Collection/Components/Filters.vue"; import StyleGuide from "@/Pages/Collection/Components/StyleGuide.vue"; const toast = useToast(); +import ScrollButton from "@/Components/ScrollButton.vue"; + import ChatMessageV2 from "@/Pages/Chat/ChatMessageV2.vue"; import DisplayMenu from "@/Components/DisplayMenu.vue"; import {Switch, SwitchGroup, SwitchLabel} from '@headlessui/vue' @@ -19,6 +21,7 @@ const props = defineProps({ messages: Object, }) + const emits = defineEmits(['chatSubmitted']) const errors = ref({}) @@ -78,8 +81,15 @@ const alreadyCompleted = ref(false); const getting_results = ref(false) +const scrollButton = ref(null) +const bottomTarget = ref(null) + onMounted(() => { + if (scrollButton.value) { + scrollButton.value.bottomTarget = bottomTarget.value + } + chatMessages.value = props.messages; Echo.private(`collection.chat.${props.chat.chatable_id}.${props.chat.id}`) .listen('.status', (e) => { @@ -187,7 +197,7 @@ const rerun = (message) => {