Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds OSS Orama support #39

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions apps/storybook/stories/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ const demoIndexes: DemoIndexConfig = {
description: 'content',
section: 'category',
},
highlight: {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to remove it. Thanks! You could also use highlightTitle or highlightDescription

caseSensitive: false,
HTMLTag: 'b',
CSSClass: 'font-bold',
},
},
recipes: {
open: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-stencil/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"dependencies": {
"@orama/highlight": "^0.1.6",
"@orama/orama": "3.0.0",
"@orama/switch": "3.0.0",
"@orama/switch": "3.0.1",
"@oramacloud/client": "1.3.17",
g-francesca marked this conversation as resolved.
Show resolved Hide resolved
"@phosphor-icons/webcomponents": "^2.1.5",
"@stencil/core": "^4.19.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ export class ChatBox {
startChatService() {
validateCloudIndexConfig(this.el, this.index, this.clientInstance)
const oramaClient = this.clientInstance || initOramaClient(this.index)
const switchInstance = new Switch(oramaClient)
// TODO check this, we're initializing Switch in the ChatService constructor
// const switchInstance = new Switch(oramaClient)

chatContext.chatService = new ChatService(switchInstance)
chatContext.chatService = new ChatService(oramaClient)
}

render() {
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-stencil/src/services/ChatService.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { AnswerSession as OSSAnswerSession } from '@orama/orama'
import type { AnyOrama, AnswerSession as OSSAnswerSession } from '@orama/orama'
import type { AnswerSession as CloudAnswerSession } from '@oramacloud/client'
import type { OramaSwitchClient } from '@orama/switch'
import { Switch } from '@orama/switch'
import { OramaClientNotInitializedError } from '@/erros/OramaClientNotInitialized'
import { chatContext, TAnswerStatus } from '@/context/chatContext'

export class ChatService {
oramaClient: Switch
oramaClient: Switch<OramaSwitchClient>
answerSession: CloudAnswerSession | OSSAnswerSession

constructor(oramaClient: OramaSwitchClient) {
Expand Down
18 changes: 9 additions & 9 deletions pnpm-lock.yaml

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

Loading