cheshire-cat-ai / api-client-py Goto Github PK
View Code? Open in Web Editor NEWAPI Client to communicate with the Cheshire Cat AI
Home Page: https://cheshire-cat-ai.github.io/api-client-py/
API Client to communicate with the Cheshire Cat AI
Home Page: https://cheshire-cat-ai.github.io/api-client-py/
The actually send method (cat_client.py line 120) send a ws message with only "text" parameter. To permit a better integrations with 3rd party tools can be useful to have a second method (eg send_with_params) that permit to send a custom json in additional to text, eg:
"text": message,
"custom_settings": json_string
Obviously this additional setting need to be managed by a plugin on cat server side.
No response
No response
Hello Nicola.
Thank you for the answer in the other issue #Furrmidable-Crew/schrodinger_cat#1 (comment).
I tried to upload a .txt from my computer to the cat using https://github.com/cheshire-cat-ai/api-client-py.git and everything worked without any issue.
My goal was to load a document (stored in the plugin folder) inside the declarative memory of the cat just asking it to him.
So I tried to:
the cat gave me this output error in loading the plugin :
cheshire_cat_core | [2023-09-23 09:43:29.325] WARNING cat.mad_hatter.MadHatter.toggle_plugin::228 => 'Toggle plugin 08_upload file from plug in v3: Activate' cheshire_cat_core | [2023-09-23 09:43:32.106] ERROR cat.mad_hatter.Plugin._load_hooks_and_tools::183 => ('Error in cat.plugins.08_upload file from plug in v3.scripts.release_notes: ' cheshire_cat_core | [2023-09-23 09:43:32.106] ERROR cat.mad_hatter.Plugin._load_hooks_and_tools::183 => "'TAG'")
The question are:
This one below is the main code of the plugin but I think it is not required.
tool_caricamento_file.txt
`from cheshire_cat_api.api.rabbit_hole_api import RabbitHoleApi
from cheshire_cat_api.api_client import ApiClient
from cheshire_cat_api.configuration import Configuration
file=open("example.txt","w")
conf = Configuration()
api_client=ApiClient(conf)
api_instance = RabbitHoleApi(api_client)
api_response = api_instance.upload_file("example.txt")`
this snippet creates an empty txt file and tries to upload it through the rabbit hole api and fails because the host isn't specified
I believe this is a bug because the rabbit hole api docs say # Defining the host is optional and defaults to http://localhost
Python 3.10.11
annotated-types==0.6.0
beautifulsoup4==4.12.2
bs4==0.0.1
certifi==2023.11.17
cffi==1.16.0
charset-normalizer==3.3.2
cheshire_cat_api==1.4.1
cryptography==42.0.5
idna==3.6
pdfminer.six==20221105
pdfplumber==0.10.4
Pillow==9.5.0
pycparser==2.21
pycryptodome==3.16.0
pydantic==2.6.2
pydantic_core==2.16.3
PyPDF2==3.0.1
pypdfium2==4.27.0
python-dateutil==2.8.2
requests==2.31.0
six==1.16.0
soupsieve==2.5
typing_extensions==4.9.0
urllib3==2.0.7
websocket-client==1.7.0
I was wondering how I should use this library to interact with the cat from outside: the "send" method looks to be asynchronous but how can I get the result of a message to be used by other services?
Let's say I want to integrate the cat with Microsoft Teams: I'd like to use this library as "man in the middle" but I can't because I can't get the answer from the "send" method.
Am I missing something?
No response
No response
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.