-
Notifications
You must be signed in to change notification settings - Fork 67
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
Bing Chatbot support #225
Comments
Assuming this bot is presented like other Skype bots, SkPy should be able to interact with it -- you'll need to be more specific on what's actually not working (see also the issue template). |
It isn't easy to be more specific as I am accessing the library through a third-party app (Skyperious). The developer pointed out that he cannot fix this as the app relies on SkPy. I have the "Skype" bot on my account and that is backed up fine, so there must be something different in the new chatbot. The Skyperious dev stated he couldn't get it to work either. |
Assuming this is the bot in question, I don't see any problems accessing its messages (my test account is not authorised to actually use the bot, though it does still seem to respond in a regular chat): >>> sk.contacts.bot('cf0e6215-34fe-409b-9e4b-135d7f3aa13b')
SkypeBotUser(id='cf0e6215-34fe-409b-9e4b-135d7f3aa13b', name='Bing', avatar='https://bot-framework.azureedge.net/bot-icons-v1/OpenAiConnectProdBot_3IMAxA3sY6L41gsG8U7ca86E9uJANz54oFcZFvf9IC3tyEr3.png', developer='', trusted=True, locales=[], rating=0.0, description='Chat with Bing in Skype for quick answers and creative ideas to enhance any conversation. Bing can help you plan a trip, write a funny haiku, find answers from the web, and more. Just mention @Bing and ask!')
>>> sk.chats['28:cf0e6215-34fe-409b-9e4b-135d7f3aa13b']
SkypeSingleChat(id='28:cf0e6215-34fe-409b-9e4b-135d7f3aa13b', alerts=True, userId='cf0e6215-34fe-409b-9e4b-135d7f3aa13b')
>>> sk.chats['28:cf0e6215-34fe-409b-9e4b-135d7f3aa13b'].getMsgs()
[SkypeTextMsg(id='1677763246411', type='RichText', time=datetime.datetime(2023, 3, 2, 13, 20, 46, 346000), clientId='2470777693493059435', userId='cf0e6215-34fe-409b-9e4b-135d7f3aa13b', chatId='28:cf0e6215-34fe-409b-9e4b-135d7f3aa13b', content='I\'m sorry! (sad) I can\'t reply to you. If you have not joined the Bing waitlist yet, please <a href="https://go.skype.com/bingchatlearnmore">join here</a>.'),
SkypeTextMsg(id='1677763244457', type='RichText', time=datetime.datetime(2023, 3, 2, 13, 20, 43, 943000), clientId='16797972230821603272', userId='fred.2', chatId='28:cf0e6215-34fe-409b-9e4b-135d7f3aa13b', content='Hi')] I'd suggest asking the Skyperious dev to chime in here if you're not using SkPy directly. |
I've left a message with the Skyperious dev asking him to join in. Hopefully he can add some insight here. |
I can confirm that the Bing bot and its chat and messages are visible when addressing them directly, via The problem is that its chat is not returned from At least that is the result in my setup, and apparently also in @robbely's setup. @Terrance, is the result different for you - does the chat get listed in |
Looks like bots aren't being included at all, and we need to opt in to more chat types when requesting recent chats. Can you give f09e922 a go? That should match what Skype for Web is requesting, and seems to be sufficient to include bots in the list of chats. |
The linked version works better, in that the Bing-bot chat is present in recent chats. But there is some weirdness in whether the bot contact is returned as When But if the chat is queried first, then its sk.contacts.bot("cf0e6215-34fe-409b-9e4b-135d7f3aa13b")
SkypeContact(id=u'cf0e6215-34fe-409b-9e4b-135d7f3aa13b', name=u'Bing', location=Location(), avatar=u'https://bot-framework.azureedge.net/bot-icons-v1/OpenAiConnectProdBot_3IMAxA3sY6L41gsG8U7ca86E9uJANz54oFcZFvf9IC3tyEr3.png', authorised=True, blocked=False, favourite=False) The same applies for other bot users as well, like the |
This is ultimately a limitation of Skype's APIs -- the contacts API will return bots you've started a chat with, with no indication from there that they're a bot, which means you'll get a If you need accurate representations, call |
I got message from bingchat:"Sorry, I am not compatible with older versions of Skype. Please update to the latest Skype for us to talk. Thank you! (smileeyes)" |
It can be solved by add
|
I've added a24999d to send that header -- not keen on coding a version in, but it seems to accept all nines which should hopefully keep it going for now. (I did try reading the version from the Skype for Web page, but it needs both a valid User-Agent else you hit the unsupported platform page, and working authentication that seems to be invalidated after you request the page...) |
@Terrance Any plans to make a new release with these changes? |
I assume the above commit is sufficient to get things working for you? |
Yes, f09e922 got bots included in recent chats. |
Released in 0.10.5. |
Unfortunately, this does not quite seem to be the case. >>> bb = sk.contacts.bots()
>>> sk.contacts.sync()
>>> c = sk.chats["28:cf0e6215-34fe-409b-9e4b-135d7f3aa13b"]
>>> c
SkypeSingleChat(id='28:cf0e6215-34fe-409b-9e4b-135d7f3aa13b', alerts=True, userId='cf0e6215-34fe-409b-9e4b-135d7f3aa13b')
>>> c.user
SkypeContact(id='cf0e6215-34fe-409b-9e4b-135d7f3aa13b', name=Name(first='Bing'), location=Location(), avatar='https://bot-framework.azureedge.net/bot-icons-v1/OpenAiConnectProdBot_3IMAxA3sY6L41gsG8U7ca86E9uJANz54oFcZFvf9IC3tyEr3.png', authorised=True, blocked=False, favourite=False) May this be because the Bing bot is not actually among the ones returned from >>> next((x for x in bb if "Bing" in x.name), "nope")
'nope' |
That's annoying -- it looks like Skype for Web fetches the bot info for that bot explicitly, I guess it's special-cased and known ahead of time (it does have its own category in the contact list), but it's still a bit weird that it's not included in the full list. Potential workarounds:
In either case you can explicitly fetch a given user ID as a bot with |
The caching interferes with this. Once the chat object has been returned, directly from However, |
Indeed, the cache retains the type it first encountered -- you could interact with the cache directly via
So far I've left prefixes out of contacts, which is a bit of a historical pain point (during early guesswork it was assumed that Implementation-wise, this probably wants a dispatching parser like |
Skyperious is a github project that uses SkPy (you're probably already aware of it) to backup Skype conversations.
The recent Bing Chatbot, however is not being backed up (although it appears in my contacts like a regular contact), and the developer indicated the issues is likely with SkPy.
The chatbot conversations are clearly being stored online as I can access them from any device running Skype.
Does SkPy support accessing Bing Chatbot conversations or are there any plans for this support in the future?
The text was updated successfully, but these errors were encountered: