How to make an Agent available via API

Hi I’m new to using the DeepPavlov framework and I’m having a few issues understanding how everything fits together.

Is it possible to create an Agent in Python with many Skills (e.g. PatternMatchingSkill, FAQ) and then make that agent available via API? Or do I need to create a configuration file for it if I want to make it available by API?

Hi!

If you mean deeppavlov.core.agent.agent.Agent under “Agent” and deeppavlov.core.skill.skill.Skill under “Skills”, please note that these entities will be depriciated soon.

Please refer this repo: https://github.com/deepmipt/dp-agent for your purposes.

We are developing DeepPavlov Agent now. It is designed exactly for what you want - to build pipelines from many skills and make them available via different channels (including REST API).

Thats great thank you!

But please note, that we only started dp-agent development. It will be more user-friendly soon =)))

1 Like

Are there any examples for English bots yet?

I’m trying to integrate my Rasa model with the framework, is this all I’ll need for the config?

from functools import partial

from state_formatters.dp_formatters import *

DB_NAME = ‘test’
DB_HOST = ‘127.0.0.1’
DB_PORT = 27017
DB_PATH = ‘/data/db’

MAX_WORKERS = 4

AGENT_ENV_FILE = “agent.env”

SKILLS = [
{
“name”: “rasa_skill”,
“protocol”: “http”,
“host”: “127.0.0.1”,
“port”: 2080,
“endpoint”: “model”,
“path”: “…/…/rasa_skill_template.json”,
“env”: {
“CUDA_VISIBLE_DEVICES”: “”
},
“profile_handler”: True,
“dockerfile”: “dockerfile_skill_cpu”,
“formatter”: rasa_formatter
}
]

ANNOTATORS_1 = []

ANNOTATORS_2 = []

ANNOTATORS_3 = []

SKILL_SELECTORS = []

RESPONSE_SELECTORS = []

POSTPROCESSORS = []

where does the “path” variable have to point to?