Comments (9)
Hi! This is not the intended way to use the client. Sorry, I should remove that documentation.
Take a look here, there is an example snippet to upload a file. Namely:
import cheshire_cat_api as ccat
from cheshire_cat_api.models.body_upload_url import BodyUploadUrl
# A config is necessary to set up base parameters like
# URL, port, user_id, etc.
config = ccat.Config(user_id="my_user_42")
# Connect to the API
cat_client = ccat.CatClient(
config=config
)
# Please note that interacting with the RabbitHole to upload
# a URL requires structuring the body like this
body_upload_url = BodyUploadUrl(
url="https://cheshire-cat-ai.github.io/docs/conceptual/cheshire_cat/rabbit_hole/"
)
# then you can make the request as follows
response = cat_client.rabbit_hole.upload_url(body_upload_url)
from api-client-py.
I realized I pasted the example to upload a url, the code for a file is
response = cat_client.rabbit_hole.upload_file(file_path)
from api-client-py.
Thank you for the response. It makes sense that it is not the intended behaviour but I was confused by the documentation.
Would it be ok for me to send a pr with fixes to the documentation of the rabbir hole api? Because the current example for the upload_file method deosn't even run.
from api-client-py.
Which error do you get?
If you want to make a pr to fix the documentation you linked, that should be removed completely since it is autogenerated.
It would be nice, but demanding to have a nice docs like the one of the cat with mkdocs and hosted on github pages.
If you feel like setting this up would be a huge contribution
from api-client-py.
I get this error
Traceback (most recent call last): File "D:\stregatto\a.txt", line 9, in <module> configuration = cheshire_cat_api.Configuration( AttributeError: module 'cheshire_cat_api' has no attribute 'Configuration'. Did you mean: 'configuration'?
It is caused because the class is Configuration while the file is all lowercase so you need to import it with
from cheshire_cat_api.configuration import Configuration
If I want to contribute to the docs the correct way should be by contributing to this repo, right?
from api-client-py.
Please, take a look at the whole code in the snippet I shared before. This is how you import the config
import cheshire_cat_api as ccat
from cheshire_cat_api.models.body_upload_url import BodyUploadUrl
# A config is necessary to set up base parameters like
# URL, port, user_id, etc.
config = ccat.Config(user_id="my_user_42")
from api-client-py.
Your code snipped does work. What I was saying is that the example code for the upload_file method in the documentation does not work because of a wrong import.
from api-client-py.
Yes, that documentation is autogenerated and should be removed
from api-client-py.
If the bug is solved I'm closing the issue, feel free to open it again if you have any other trouble
from api-client-py.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api-client-py.