@moonr/bing4
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published
npm install bing-sydney-ai

Examples

import { SydneyClient } from "./sydney";
import Message from "./sydney/Message";
import SearchResult from "./sydney/SearchResult";

(async () => {
    let sydney = new SydneyClient();
    await sydney.startConversation();
    sydney.setSearch(false);
    let response: Message = await sydney.ask('what do you see on this image?', {
        attachment: 'test.png',
        
        webSearch: (search: SearchResult[]) => {
            console.log('Web search results:');

            for (let searchResult of search) {
                console.log('Title:', searchResult.title);
                console.log('URL:', searchResult.url);
                console.log('Snippets:', searchResult.snippets.join('\n'));
                console.log('---');
            }
        },
        messageUpdate: (message: Message) => {
            console.log('Message update:', message.text);
        },
        messageAdded: (message: Message) => {
            console.log('Message added:', message.text);
        }
    });

    console.log('Response:', response.text);
    console.log('suggested responses:', response.suggestedResponses);
})();

Contribute

https://github.com/borsuczyna/bing-sydney-ai

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.01latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.01
1.0.00

Package Sidebar

Install

npm i @moonr/bing4

Weekly Downloads

1

Version

2.0.0

License

none

Unpacked Size

34.6 kB

Total Files

26

Last publish

Collaborators

  • moonr