repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | --- |
| #2 | title: '📃 JSON' |
| #3 | --- |
| #4 | |
| #5 | To add any json file, use the data_type as `json`. Headers are included for each line, so for example if you have a json like `{"age": 18}`, then it will be added as `age: 18`. |
| #6 | |
| #7 | Here are the supported sources for loading `json`: |
| #8 | |
| #9 | ``` |
| #10 | 1. URL - valid url to json file that ends with ".json" extension. |
| #11 | 2. Local file - valid url to local json file that ends with ".json" extension. |
| #12 | 3. String - valid json string (e.g. - app.add('{"foo": "bar"}')) |
| #13 | ``` |
| #14 | |
| #15 | <Tip> |
| #16 | If you would like to add other data structures (e.g. list, dict etc.), convert it to a valid json first using `json.dumps()` function. |
| #17 | </Tip> |
| #18 | |
| #19 | ## Example |
| #20 | |
| #21 | <CodeGroup> |
| #22 | |
| #23 | ```python python |
| #24 | from embedchain import App |
| #25 | |
| #26 | app = App() |
| #27 | |
| #28 | # Add json file |
| #29 | app.add("temp.json") |
| #30 | |
| #31 | app.query("What is the net worth of Elon Musk as of October 2023?") |
| #32 | # As of October 2023, Elon Musk's net worth is $255.2 billion. |
| #33 | ``` |
| #34 | |
| #35 | |
| #36 | ```json temp.json |
| #37 | { |
| #38 | "question": "What is your net worth, Elon Musk?", |
| #39 | "answer": "As of October 2023, Elon Musk's net worth is $255.2 billion, making him one of the wealthiest individuals in the world." |
| #40 | } |
| #41 | ``` |
| #42 | </CodeGroup> |
| #43 | |
| #44 | |
| #45 |