Giter VIP home page Giter VIP logo

dp-agent's Introduction

DeepPavlov Agent

DeepPavlov Agent is a platform for creating multi-skill chatbots.

Please refer to our readthedocs documentation.

dp-agent's People

Contributors

deeppavlovadmin avatar dilyararimovna avatar ignatovfedor avatar kudep avatar litinsky avatar my-master avatar nickvolynkin avatar p-rdx 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

Watchers

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

dp-agent's Issues

Can not test in console after second start

After docker-compose crashed unexpectedly I've re-run docker-compose up --build and can not to use console chat anymore, I'm stucking with problem:

root@6e86a2a4998d:/dp-agent# (.venv3) alx@x3:~/Workspace/dp-agent$ sudo docker exec -it agent /bin/bash
root@6e86a2a4998d:/dp-agent# python3 -m core.run
[nltk_data] Downloading package punkt to /root/nltk_data...
[nltk_data]   Package punkt is already up-to-date!
[nltk_data] Downloading package stopwords to /root/nltk_data...
[nltk_data]   Package stopwords is already up-to-date!
[nltk_data] Downloading package perluniprops to /root/nltk_data...
[nltk_data]   Package perluniprops is already up-to-date!
[nltk_data] Downloading package nonbreaking_prefixes to
[nltk_data]     /root/nltk_data...
[nltk_data]   Package nonbreaking_prefixes is already up-to-date!
Provide user id: 4
You (4): приветушки
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/requests/packages/urllib3/connection.py", line 142, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/usr/local/lib/python3.6/dist-packages/requests/packages/urllib3/util/connection.py", line 91, in create_connection
    raise err
  File "/usr/local/lib/python3.6/dist-packages/requests/packages/urllib3/util/connection.py", line 81, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/requests/packages/urllib3/connectionpool.py", line 578, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.6/dist-packages/requests/packages/urllib3/connectionpool.py", line 362, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.6/http/client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/lib/python3.6/http/client.py", line 964, in send
    self.connect()
  File "/usr/local/lib/python3.6/dist-packages/requests/packages/urllib3/connection.py", line 167, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.6/dist-packages/requests/packages/urllib3/connection.py", line 151, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0x7ff1f3b48278>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/requests/adapters.py", line 403, in send
    timeout=timeout
  File "/usr/local/lib/python3.6/dist-packages/requests/packages/urllib3/connectionpool.py", line 623, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.6/dist-packages/requests/packages/urllib3/util/retry.py", line 281, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='chitchat', port=2081): Max retries exceeded with url: /skill (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7ff1f3b48278>: Failed to establish a new connection: [Errno 111] Connection refused',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/dp-agent/core/run.py", line 166, in <module>
    main()
  File "/dp-agent/core/run.py", line 161, in main
    responses = message_processor([message], [1])
  File "/dp-agent/core/run.py", line 142, in infer_cmd
    date_times=date_times, locations=locations, channel_types=['cmd_client'] * len(messages))
  File "/dp-agent/core/agent.py", line 36, in __call__
    selected_skills = self.skill_manager.get_skill_responses(me_dialogs)
  File "/dp-agent/core/skill_manager.py", line 82, in get_skill_responses
    skill_responses = self.skill_caller(payload=payloads, names=skill_names, urls=skill_urls)
  File "/dp-agent/core/rest_caller.py", line 36, in __call__
    for preprocessed in zip(*self.executor.map(_make_request, names, urls, payload)):
  File "/usr/lib/python3.6/concurrent/futures/_base.py", line 586, in result_iterator
    yield fs.pop().result()
  File "/usr/lib/python3.6/concurrent/futures/_base.py", line 432, in result
    return self.__get_result()
  File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/dp-agent/core/rest_caller.py", line 8, in _make_request
    r = requests.post(url, json=payload)
  File "/usr/local/lib/python3.6/dist-packages/requests/api.py", line 111, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/requests/api.py", line 57, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 585, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/requests/adapters.py", line 467, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='chitchat', port=2081): Max retries exceeded with url: /skill (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7ff1f3b48278>: Failed to establish a new connection: [Errno 111] Connection refused',))

What may cause this?

requests header handling

When i send a request with Content-Type: application/json;charset=UTF-8 (it's default for my framework), I get an error: 400: Content-Type should be application/json.
Everything works fine if the header is overridden with Content-Type: application/json

Support for SQL Server

I wish to instead of using MongoDB, use SQL Server, as this is what I use for everything else on the host

Active skill is missed in console

The second run was little bit longer:

root@78b0394c15ef:/dp-agent# python3 -m core.run
[nltk_data] Downloading package punkt to /root/nltk_data...
[nltk_data]   Package punkt is already up-to-date!
[nltk_data] Downloading package stopwords to /root/nltk_data...
[nltk_data]   Package stopwords is already up-to-date!
[nltk_data] Downloading package perluniprops to /root/nltk_data...
[nltk_data]   Package perluniprops is already up-to-date!
[nltk_data] Downloading package nonbreaking_prefixes to
[nltk_data]     /root/nltk_data...
[nltk_data]   Package nonbreaking_prefixes is already up-to-date!
Provide user id: 2
You (2): кек
Bot:  ничо не разобрать
You (2): скажи шутку
Bot:  .Моя кошка быстреенабирает текст на клавиатуре))) Набирай слово АНЕКДОТ
You (2): анекдот
Bot:  Каждому овощу свой фрукт.
You (2): анекдот
Bot:  Люблю смотреть хорошее, качественное, большое кино!
You (2): что ты умеешь?
Bot:  Я тоже это умею.
You (2): что такое нейронная сеть?
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/dp-agent/core/run.py", line 166, in <module>
    main()
  File "/dp-agent/core/run.py", line 161, in main
    responses = message_processor([message], [1])
  File "/dp-agent/core/run.py", line 142, in infer_cmd
    date_times=date_times, locations=locations, channel_types=['cmd_client'] * len(messages))
  File "/dp-agent/core/agent.py", line 46, in __call__
    sent_responses = self.postprocessor(me_dialogs)
  File "/dp-agent/core/postprocessor.py", line 21, in __call__
    if ner_annotations and (response['active_skill'] == 'chitchat'):
  File "/usr/local/lib/python3.6/dist-packages/mongoengine/base/document.py", line 223, in __getitem__
    raise KeyError(name)
KeyError: 'active_skill'

Encoding problem in console

(.venv3) alx@x3:~/Workspace/dp-agent$ sudo docker exec -it agent /bin/bash
root@78b0394c15ef:/dp-agent# python3 -m core.run
[nltk_data] Downloading package punkt to /root/nltk_data...
[nltk_data]   Unzipping tokenizers/punkt.zip.
[nltk_data] Downloading package stopwords to /root/nltk_data...
[nltk_data]   Unzipping corpora/stopwords.zip.
[nltk_data] Downloading package perluniprops to /root/nltk_data...
[nltk_data]   Unzipping misc/perluniprops.zip.
[nltk_data] Downloading package nonbreaking_prefixes to
[nltk_data]     /root/nltk_data...
[nltk_data]   Unzipping corpora/nonbreaking_prefixes.zip.
Provide user id: 1
You (1): Привет
Bot:  Дубль два: привет!
You (1): Что умеешь?
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/dp-agent/core/run.py", line 166, in <module>
    main()
  File "/dp-agent/core/run.py", line 159, in main
    msg = input(f'You ({user_id}): ')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 11: invalid continuation byte

No CORS support

OPTION requests are not allowed and POST responses do not have CORS headers.

Access dialogue state from skills

Hi there!
Thanks for cool bot framework.

I want to fill a kind of data form for user with dp-agent bot.
Bot with user are filling this form step-by-step.
Suppose that extracted data should be stored in dialogue state to avoid any other storages out of the context of dp-agent features.
And the last step is confirmation, when all data is filled.

I want to access dialogue state information from skills (is it ok?).
According to proposed project's architecture
(this image: https://static.tildacdn.com/tild3164-3762-4439-a131-336437363736/Untitled_Diagram-DP_.jpg) all pipe components are able to access dialogues states.

Based on examples - in the service of Skill (like in any other pipe component) we have an access to HTTP request only.
And it contains only array of sentences. So - even if I will try to request data directly from MongoDB (not from dialogue state service) - I even don't have a dialogue identifier.

Probably, I missed some basics in understanding of dp-agent pipe. :)
Some, could you please then explain the logic...

Timeouts for components

Hello!

It will be very useful to have an opportunity to provide a timeout for each component in the pipeline.

Thank you in advance.

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.