Skip to content

Commit

Permalink
Merge pull request #925 from ManishMadan2882/main
Browse files Browse the repository at this point in the history
Untraced types in react widget
  • Loading branch information
dartpain authored Apr 14, 2024
2 parents 19bb1b4 + c30c6d9 commit 3d76323
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions extensions/react-widget/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion extensions/react-widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"scripts": {
"build": "parcel build src/index.ts",
"dev": "parcel",
"dev": "parcel src/index.html -p 3000",
"test": "jest",
"lint": "eslint",
"check": "tsc --noEmit",
Expand Down
3 changes: 1 addition & 2 deletions extensions/react-widget/src/components/DocsGPTWidget.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"use client";
import { Fragment, useEffect, useRef, useState } from 'react'
import { PaperPlaneIcon, RocketIcon, ExclamationTriangleIcon, Cross2Icon } from '@radix-ui/react-icons';
import { MESSAGE_TYPE } from '../models/types';
import { Query, Status } from '../models/types';
import { MESSAGE_TYPE, Query, Status } from '../types/index';
import MessageIcon from '../assets/message.svg'
import { fetchAnswerStreaming } from '../requests/streamingApi';
import styled, { keyframes, createGlobalStyle } from 'styled-components';
Expand Down
13 changes: 13 additions & 0 deletions extensions/react-widget/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export type MESSAGE_TYPE = 'QUESTION' | 'ANSWER' | 'ERROR';
export type Status = 'idle' | 'loading' | 'failed';
export type FEEDBACK = 'LIKE' | 'DISLIKE';

export interface Query {
prompt: string;
response?: string;
feedback?: FEEDBACK;
error?: string;
sources?: { title: string; text: string }[];
conversationId?: string | null;
title?: string | null;
}

0 comments on commit 3d76323

Please sign in to comment.