uezo / minette-python Goto Github PK
View Code? Open in Web Editor NEWMinette is a minimal and extensible chatbot framework.
License: Other
Minette is a minimal and extensible chatbot framework.
License: Other
When I store store user info, the user name in Japanese was stored as '????' in Azure SQL database.
This should be caused by using String
to define the column, not NVARCHAR
.
Pass Session object of SQLAlchemy to DialogService instead of database connection.
channel: LINE / uid: A => minette_uid: user01
channel: FB / uid: B => minette_uid: user02
channel: FB / uid: C => minette_uid: user03
If LINE/A and FB/C is the same user and to treat as the same user in the botapp, then I have to change user_id_mapper table directly.
I want to customize the mapping rule easily without SQL.
Session and SessionStore: minette.session.session_store => minette.session
User and UserRepository: minette.user.user_repository => minette.user
Classifier: minette.dialog.classifier => minette.dialog
DialogService: minette.dialog.dialog_service => minette.dialog
Message and MessageLogger: minette.dialog.message => minette.dialog
When I want to change .db file names from minette.db to other, we should create instances of SessionStore, UserRepository and MessageLogger with connection_str and then call automata.create() by passing them.
I want to change them call automata.create() by passing just class names as arguments.
For a single function bot that doesn't need classifier.
Accepting text messages only like console, using Message class is required.
bot.execute("hello") is smarter in this use case.
Payload should have some methods like get() and save(path).
They simply download from the URL with headers that is set to payload object.
Now conn.connect() and conn.close() at every database operations. These costs are not to be ignorable when connecting database over the Internet.
To trace this problem, we need raw JSON logging function. (We can see the character codes in raw JSON)
プロジェクト内でKey-Valueで/イテレーションでアクセスできる場合とそうでない場合の両方を考慮して都度判定してから処理を行う・・・というのがいまいち。最初からdictに統一した方が楽。
For production environment.
JSON serialization should be supported to be saved in RDBMS and for interoperability.
setup.py で __version__
を得るために minette ライブラリからimportしていますが、そこでpytzを参照しているからと予想されます。install_requireが効く前です。環境はPython 3.6.2 on Mac (pyenv使用)
$ pip install minette
Collecting minette
Downloading minette-0.1.dev23.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/cr/b5nntcfd27j5sh_s9fpsdmgh0000gn/T/pip-build-ra9r6anl/minette/setup.py", line 2, in <module>
from minette import __version__
File "/private/var/folders/cr/b5nntcfd27j5sh_s9fpsdmgh0000gn/T/pip-build-ra9r6anl/minette/minette/__init__.py", line 2, in <module>
from minette.automata import Automata, create, get_default_logger
File "/private/var/folders/cr/b5nntcfd27j5sh_s9fpsdmgh0000gn/T/pip-build-ra9r6anl/minette/minette/automata.py", line 5, in <module>
from pytz import timezone
ModuleNotFoundError: No module named 'pytz'
bot = automata.create(
connection_provider=MySQLConnectionProvider,
session_store=MySQLSessionStore,
user_repository=MySQLUserRepository,
message_logger=MySQLMessageLogger
)
to
bot = automata.create(
database="mysql"
)
or switch by config file.
[minette]
database = mysql
Type hints are useful but Python 3.5 or higher is required. Remove it and use docstring instead is better I think.
Hello,
I am passing in a User model in my adapter for profile_image_url, name and nickname however it appears the userstore.py needs to make change to allow the user object to be passed into get() method
user = user or User(channel=channel, channel_user_id=channel_user_id)
and additionally change to _get_user() in core.py to accept the passed in user model.
Would you agree? If so I can create a pull request.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.