@fireaw.ai/sdk
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -11,3 +11,3 @@ type Message = { | ||
apiToken: string; | ||
collectionId: string; | ||
chatbotId: string; | ||
onMessage: (message: Message) => void; | ||
@@ -18,10 +18,10 @@ host?: string; | ||
private readonly apiToken; | ||
private readonly collectionId; | ||
private readonly chatbotId; | ||
private readonly channel; | ||
private readonly onMessage; | ||
private readonly host; | ||
private chat; | ||
chat: any; | ||
private consumer?; | ||
private subscription?; | ||
constructor({ apiToken, collectionId, onMessage, host, }: ChatChannelProps); | ||
constructor({ apiToken, chatbotId, onMessage, host, }: ChatChannelProps); | ||
connect(): Promise<void>; | ||
@@ -28,0 +28,0 @@ get apiHost(): string; |
@@ -14,5 +14,5 @@ "use strict"; | ||
class ChatChannel { | ||
constructor({ apiToken, collectionId, onMessage, host = "www.fireaw.ai", }) { | ||
constructor({ apiToken, chatbotId, onMessage, host = "www.fireaw.ai", }) { | ||
this.apiToken = apiToken; | ||
this.collectionId = collectionId; | ||
this.chatbotId = chatbotId; | ||
this.channel = "ChatChannel"; | ||
@@ -49,3 +49,3 @@ this.onMessage = onMessage; | ||
chat: { | ||
collection_id: this.collectionId, | ||
collection_id: this.chatbotId, | ||
}, | ||
@@ -52,0 +52,0 @@ }), |
{ | ||
"name": "@fireaw.ai/sdk", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "build": "mkdir -p dist; tsc; cp package.json README.md LICENSE dist", |
@@ -21,4 +21,4 @@ # Fireaw.ai SDK | ||
// Copy the collection id from the website view in https://www.fireaw.ai | ||
collectionId: "<your collection id here>", | ||
// Copy the chatbot id from the publish tab in https://www.fireaw.ai | ||
chatbotId: "<your chatbot id here>", | ||
@@ -25,0 +25,0 @@ // Will be called each time a new message is received (both user and assistant messages) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7248