[Query Copilot] Allocation of container and copilot request sent to Phoenix endpoint (#1576)

* Switch to tools federation endpoints for query copilot

* Remove extra / in url

* Initial allocateContainer implementation

* Additional feedback modal changes

* updated tests

* PhoenixClient reverted to previous endpoint

* Changes based on PR comments

* Update based on tests

* updated endpoint

* Back to previous implementation and test improve

* removing notebook

---------

Co-authored-by: Victor Meng <vimeng@microsoft.com>
Co-authored-by: Predrag Klepic <v-prklepic@microsoft.com>
This commit is contained in:
Predrag Klepic
2023-08-18 10:47:19 +02:00
committed by GitHub
parent 19041ffedd
commit 9c1b9e6ff6
10 changed files with 147 additions and 62 deletions

View File

@@ -30,6 +30,7 @@ export interface QueryCopilotState {
showWelcomeSidebar: boolean;
showCopilotSidebar: boolean;
chatMessages: string[];
shouldAllocateContainer: boolean;
openFeedbackModal: (generatedQuery: string, likeQuery: boolean, userPrompt: string) => void;
closeFeedbackModal: () => void;
@@ -59,6 +60,8 @@ export interface QueryCopilotState {
setShowCopilotSidebar: (showCopilotSidebar: boolean) => void;
setChatMessages: (chatMessages: string[]) => void;
setShouldAllocateContainer: (shouldAllocateContainer: boolean) => void;
resetQueryCopilotStates: () => void;
}
@@ -91,6 +94,7 @@ export const useQueryCopilot: QueryCopilotStore = create((set) => ({
showWelcomeSidebar: true,
showCopilotSidebar: false,
chatMessages: [],
shouldAllocateContainer: true,
openFeedbackModal: (generatedQuery: string, likeQuery: boolean, userPrompt: string) =>
set({ generatedQuery, likeQuery, userPrompt, showFeedbackModal: true }),
@@ -121,6 +125,7 @@ export const useQueryCopilot: QueryCopilotStore = create((set) => ({
setShowWelcomeSidebar: (showWelcomeSidebar: boolean) => set({ showWelcomeSidebar }),
setShowCopilotSidebar: (showCopilotSidebar: boolean) => set({ showCopilotSidebar }),
setChatMessages: (chatMessages: string[]) => set({ chatMessages }),
setShouldAllocateContainer: (shouldAllocateContainer: boolean) => set({ shouldAllocateContainer }),
resetQueryCopilotStates: () => {
set((state) => ({
@@ -150,6 +155,7 @@ export const useQueryCopilot: QueryCopilotStore = create((set) => ({
wasCopilotUsed: false,
showCopilotSidebar: false,
chatMessages: [],
shouldAllocateContainer: true,
}));
},
}));