Skip to content

Commit

Permalink
removed plotly
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Seabock (Centific Technologies Inc) committed Jul 3, 2024
1 parent 80bc2ed commit f91ffd8
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 3,911 deletions.
3,757 changes: 71 additions & 3,686 deletions frontend/package-lock.json

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@
"dompurify": "^3.0.8",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"plotly.js": "^2.32.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-markdown": "^7.0.1",
"react-plotly.js": "^2.6.0",
"react-router-dom": "^6.8.1",
"react-syntax-highlighter": "^15.5.0",
"react-uuid": "^2.0.0",
Expand All @@ -44,7 +42,6 @@
"@types/node": "^20.12.7",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@types/react-plotly.js": "^2.6.3",
"@types/react-syntax-highlighter": "^15.5.11",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
Expand All @@ -70,4 +67,4 @@
"typescript": "^4.9.5",
"vite": "^4.1.5"
}
}
}
9 changes: 1 addition & 8 deletions frontend/src/api/models.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Plotly from 'react-plotly.js'

export type AskResponse = {
answer: string
citations: Citation[]
Expand Down Expand Up @@ -27,17 +25,12 @@ export type ToolMessageContent = {
intent: string
}

export type AzureSqlServerCodeExecResult = {
data: Plotly.Data[]
layout: Partial<Plotly.Layout>
}

export type AzureSqlServerExecResult = {
intent: string
search_query: string | null
search_result: string | null
code_generated: string | null
code_exec_result?: AzureSqlServerCodeExecResult | undefined
code_exec_result?: string | undefined
}

export type AzureSqlServerExecResults = {
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/Answer/Answer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { ThumbDislike20Filled, ThumbLike20Filled } from '@fluentui/react-icons'
import DOMPurify from 'dompurify'
import remarkGfm from 'remark-gfm'
import supersub from 'remark-supersub'
import Plot from 'react-plotly.js'
import { AskResponse, Citation, Feedback, historyMessageFeedback } from '../../api'
import { XSSAllowTags, XSSAllowAttributes } from '../../constants/sanatizeAllowables'
import { AppStateContext } from '../../state/AppProvider'
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Answer/AnswerParser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const sampleCitations: Citation[] = [
const sampleAnswer: AskResponse = {
answer: 'This is an example answer with citations [doc1] and [doc2].',
citations: cloneDeep(sampleCitations),
plotly_data: null
generated_chart: null
}

describe('enumerateCitations', () => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Answer/AnswerParser.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cloneDeep } from 'lodash'

import { AskResponse, Citation, AzureSqlServerCodeExecResult } from '../../api'
import { AskResponse, Citation } from '../../api'

export type ParsedAnswer = {
citations: Citation[]
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/pages/chat/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -709,9 +709,7 @@ const Chat = () => {
try {
const execResults = JSON.parse(message.content) as AzureSqlServerExecResults;
const codeExecResult = execResults.all_exec_results.at(-1)?.code_exec_result;
console.log('execResults :', execResults);
console.log("codeExecResult: ", codeExecResult && atob(codeExecResult.toString()))
// codeExecResult && setChart(atob(codeExecResult.toString()))

if (codeExecResult === undefined) {
return null;
}
Expand Down
25 changes: 0 additions & 25 deletions static/assets/Contoso-ff70ad88.svg

This file was deleted.

10 changes: 0 additions & 10 deletions static/assets/Send-d0601aaa.svg

This file was deleted.

1 change: 0 additions & 1 deletion static/assets/index-61492790.css

This file was deleted.

Loading

0 comments on commit f91ffd8

Please sign in to comment.