Coder Social home page Coder Social logo

susi_api_wrapper's People

Contributors

anupkumarpanwar avatar betterclever avatar chiragw15 avatar felixonmars avatar mariobehling avatar orbiter avatar prabhupant avatar prateekiiest avatar sansyrox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

susi_api_wrapper's Issues

To Update the endpoint to showcase Smart Speaker in device Section

Current Behaviour
Right now, the API endpoint has been changed in the server which allowed the Smart Speaker to be shown under the devices tab of chat.susi.ai

Expected Behaviour
To update the API call and make it functional again

Would you like to work on it?
Yes

Move response decoders to separate file.

All response decoders are currently in a single file main.py . Their number are expected to grow as well. It will be best to refactor them a to separate file for cleaner code.

Add ability to directly parse Susi Response JSON

Currently, Susi Python module make an API request to Susi Server when we need to get an answer for a query.
But when we connect Susi Hardware to Susi Webclient ( Issue #26 (susi_hardware) ) , we get JSON from Susi Web client directly and no call to server is made by Hardware device running Susi, thus we need to get answers from JSON directly in that case and this Module must expose a method for that.

Improve login support

Currently, login methods are there but the token is not included in chat message request and login information (access token) is not persisted. This needs improvement.

Cut a release?

It would be nice to have a versioned release which an initial PyPI upload and distribution packaging could start with.

Change Decoder based JSON processing approach to standard decoding

Currently, we are using a Custom Decoder based SUSI Json Response parsing. While this works on many systems, it fails due on Ubuntu 16.04 due to simplejson / json library conflict since the module depends on native json library while simplejson is supplied in Ubuntu while import json.

Here is the log:

Traceback (most recent call last):
  File "main.py", line 114, in <module>
    start_speech_recognition()
  File "main.py", line 95, in start_speech_recognition
    ask_susi(value)
  File "main.py", line 62, in ask_susi
    reply = susi.ask(input_query)
  File "/home/betterclever/Github/susi_hardware/app/susi_python/main.py", line 46, in ask
    response = query(query_string)
  File "/home/betterclever/Github/susi_hardware/app/susi_python/main.py", line 22, in query
    return api_response.json(cls=SusiResponseDecoder)
  File "/usr/local/lib/python3.5/dist-packages/requests/models.py", line 894, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3/dist-packages/simplejson/__init__.py", line 533, in loads
    return cls(encoding=encoding, **kw).decode(s)
TypeError: __init__() got an unexpected keyword argument 'encoding'

This conflict can be resolved by first parsing the response to a json directly and getting the information from it to make the Response Objects.

Send country name, code and device type in chat.json API

Country code and country name are also required to get country wise usage analytics.
Refer to this PR : fossasia/susi_server#811

The type of device ie, "Smart Speaker" is required to get device wise usage analytics.
Refer to this PR :fossasia/susi_server#825

Steps to reproduce it

NA

LogCat for the issue

https://api.susi.ai/susi/chat.json?q=hello&language=en&access_token=PGbzC5zYQBQUuCrYrarqIuRe4lvjfn&latitude=30.1667&longitude=77.3

Screenshots of the issue

NA

Would you like to work on the issue?

Yes

Timezone consideration for chat

Is it possible for Susi to consider the timezone of the person talking to it? It seems to show only Central European Summer Time (CEST) when asked: "What time is it?".

I'm using sample.py for the chat.

The issue is also reflected here. Susi's response on this web page seems to be very slow too.

Use UTF-8 parsing on SUSI Server requests

UTF-8 encoding must be used explicitly for parsing output of all requests made to SUSI Server. Currently, Python 3.4 (max available on Raspberry Pi) uses ASCII Encoding by default which causes issues while parsing some responses.

Add RSS Action Type

RSS Action Type is functional now. Server is sending RSS ActionType instead of Websearch.
Library must be modified accordingly.

To add VolumeAction class in the wrapper

Actual Behaviour

Right now SUSI cannot change volume according to the user

Expected Behaviour

To add a VolumeAction class

Would you like to work on the issue?

Yes

Random text query error

Description of the bug:

Response of random text is not taken care of. Response JSON of random text returns an empty array of 'answers' key, as below :

json

This results in the following error :

bug

It is expected that the app does not stop abruptly and returns a sorry response, like 'Could not get you' or any appropriate message.

I would like to work on this issue.

Add Map Support

Map Support can be added in the module itself to provide ability to create a map image from the URL provided in Susi Response and provide it as a byte array.

Add Table Data Support

Currently, response containing table is ignored. A correct way to represent those responses must be implemented.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.