-
-
Notifications
You must be signed in to change notification settings - Fork 738
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add experimental bing client (#35)
* feat: add bing client * fix: get follow-up responses to work * docs: update readme
- Loading branch information
1 parent
6bfe8c5
commit 3f02a9e
Showing
7 changed files
with
1,471 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { BingAIClient } from '../index.js'; | ||
|
||
const bingAIClient = new BingAIClient({ | ||
userToken: '', // "_U" cookie from bing.com | ||
debug: false, | ||
}); | ||
|
||
let response = await bingAIClient.sendMessage('Write a short poem about cats', { | ||
onProgress: (token) => { | ||
process.stdout.write(token); | ||
}, | ||
}); | ||
console.log(response); | ||
|
||
response = await bingAIClient.sendMessage('Now write it in French', { | ||
conversationSignature: response.conversationSignature, | ||
conversationId: response.conversationId, | ||
clientId: response.clientId, | ||
invocationId: response.invocationId, | ||
onProgress: (token) => { | ||
process.stdout.write(token); | ||
}, | ||
}); | ||
console.log(response); |
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,3 +1,5 @@ | ||
import ChatGPTClient from './src/ChatGPTClient.js'; | ||
import BingAIClient from './src/BingAIClient.js'; | ||
|
||
export { ChatGPTClient, BingAIClient }; | ||
export default ChatGPTClient; |
Oops, something went wrong.