-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): add repository select in Answer Engine (#3619)
* feat(ui): add repository select in Answer Engine * update: code query * [autofix.ci] apply automated fixes * update * update: rename * update * update * update: rename * update: rename * [autofix.ci] apply automated fixes * update --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
84ab6f1
commit fcb1783
Showing
18 changed files
with
532 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { createContext } from 'react' | ||
|
||
import { | ||
ContextInfo, | ||
RepositorySourceListQuery | ||
} from '@/lib/gql/generates/graphql' | ||
import { ExtendedCombinedError } from '@/lib/types' | ||
|
||
import { ConversationMessage } from './types' | ||
|
||
type SearchContextValue = { | ||
// flag for initialize the pathname | ||
isPathnameInitialized: boolean | ||
isLoading: boolean | ||
onRegenerateResponse: (id: string) => void | ||
onSubmitSearch: (question: string) => void | ||
setDevPanelOpen: (v: boolean) => void | ||
setConversationIdForDev: (v: string | undefined) => void | ||
enableDeveloperMode: boolean | ||
contextInfo: ContextInfo | undefined | ||
fetchingContextInfo: boolean | ||
onDeleteMessage: (id: string) => void | ||
isThreadOwner: boolean | ||
onUpdateMessage: ( | ||
message: ConversationMessage | ||
) => Promise<ExtendedCombinedError | undefined> | ||
repositories: RepositorySourceListQuery['repositoryList'] | undefined | ||
} | ||
|
||
export const SearchContext = createContext<SearchContextValue>( | ||
{} as SearchContextValue | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { | ||
Maybe, | ||
Message, | ||
MessageAttachmentClientCode | ||
} from '@/lib/gql/generates/graphql' | ||
import { AttachmentCodeItem, AttachmentDocItem } from '@/lib/types' | ||
|
||
export type ConversationMessage = Omit< | ||
Message, | ||
'__typename' | 'updatedAt' | 'createdAt' | 'attachment' | 'threadId' | ||
> & { | ||
threadId?: string | ||
threadRelevantQuestions?: Maybe<string[]> | ||
error?: string | ||
attachment?: { | ||
clientCode?: Maybe<Array<MessageAttachmentClientCode>> | undefined | ||
code: Maybe<Array<AttachmentCodeItem>> | undefined | ||
doc: Maybe<Array<AttachmentDocItem>> | undefined | ||
} | ||
} | ||
export type ConversationPair = { | ||
question: ConversationMessage | null | ||
answer: ConversationMessage | null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.