-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: error handling & adapt queries (#6)
* Error display WIP * Assistant error handling * Adapt query & types Co-authored-by: Etienne Soulard-Geoffrion <[email protected]> * Fix assistant passages & use latest client --------- Co-authored-by: Etienne Soulard-Geoffrion <[email protected]>
- Loading branch information
Showing
10 changed files
with
1,647 additions
and
1,006 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,13 +1,22 @@ | ||
import type { Highlight } from './types'; | ||
import { | ||
V1HighlightingHit, | ||
V1HighlightingHitVector, | ||
} from '@clinia/client-common'; | ||
|
||
export const getHighlightText = (highlight: Highlight): string => { | ||
export const getHighlightText = (highlight: V1HighlightingHit): string => { | ||
if ('highlight' in highlight) { | ||
return highlight.highlight; | ||
} | ||
|
||
if (highlight.type === 'hits' || 'data' in highlight) { | ||
if (highlight.type === 'vector' || 'data' in highlight) { | ||
return highlight.data; | ||
} | ||
|
||
return ''; | ||
}; | ||
|
||
export const isVectorHighlight = ( | ||
highlight: V1HighlightingHit | ||
): highlight is V1HighlightingHitVector => { | ||
return 'type' in highlight && highlight.type === 'vector'; | ||
}; |