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 | "cells": [ |
| #3 | { |
| #4 | "cell_type": "markdown", |
| #5 | "id": "553f2e71", |
| #6 | "metadata": {}, |
| #7 | "source": [ |
| #8 | "## Embedchain chromadb server example" |
| #9 | ] |
| #10 | }, |
| #11 | { |
| #12 | "cell_type": "markdown", |
| #13 | "id": "513e12e6", |
| #14 | "metadata": {}, |
| #15 | "source": [ |
| #16 | "This notebook shows an example of how you can use embedchain with chromdb (server). \n", |
| #17 | "\n", |
| #18 | "\n", |
| #19 | "First, run chroma inside docker using the following command:\n", |
| #20 | "\n", |
| #21 | "\n", |
| #22 | "```bash\n", |
| #23 | "git clone https://github.com/chroma-core/chroma\n", |
| #24 | "cd chroma && docker-compose up -d --build\n", |
| #25 | "```" |
| #26 | ] |
| #27 | }, |
| #28 | { |
| #29 | "cell_type": "code", |
| #30 | "execution_count": 1, |
| #31 | "id": "92e7ad71", |
| #32 | "metadata": {}, |
| #33 | "outputs": [], |
| #34 | "source": [ |
| #35 | "import os\n", |
| #36 | "from embedchain import App\n", |
| #37 | "from embedchain.config import AppConfig\n", |
| #38 | "\n", |
| #39 | "\n", |
| #40 | "chromadb_host = \"localhost\"\n", |
| #41 | "chromadb_port = 8000\n", |
| #42 | "\n", |
| #43 | "config = AppConfig(host=chromadb_host, port=chromadb_port)\n", |
| #44 | "elon_bot = App(config)" |
| #45 | ] |
| #46 | }, |
| #47 | { |
| #48 | "cell_type": "code", |
| #49 | "execution_count": 2, |
| #50 | "id": "1a6d6841", |
| #51 | "metadata": {}, |
| #52 | "outputs": [ |
| #53 | { |
| #54 | "name": "stdout", |
| #55 | "output_type": "stream", |
| #56 | "text": [ |
| #57 | "All data from https://en.wikipedia.org/wiki/Elon_Musk already exists in the database.\n", |
| #58 | "All data from https://www.tesla.com/elon-musk already exists in the database.\n" |
| #59 | ] |
| #60 | } |
| #61 | ], |
| #62 | "source": [ |
| #63 | "# Embed Online Resources\n", |
| #64 | "elon_bot.add(\"web_page\", \"https://en.wikipedia.org/wiki/Elon_Musk\")\n", |
| #65 | "elon_bot.add(\"web_page\", \"https://www.tesla.com/elon-musk\")" |
| #66 | ] |
| #67 | }, |
| #68 | { |
| #69 | "cell_type": "code", |
| #70 | "execution_count": 3, |
| #71 | "id": "34cda99c", |
| #72 | "metadata": {}, |
| #73 | "outputs": [ |
| #74 | { |
| #75 | "data": { |
| #76 | "text/plain": [ |
| #77 | "'Elon Musk runs four companies: Tesla, SpaceX, Neuralink, and The Boring Company.'" |
| #78 | ] |
| #79 | }, |
| #80 | "execution_count": 3, |
| #81 | "metadata": {}, |
| #82 | "output_type": "execute_result" |
| #83 | } |
| #84 | ], |
| #85 | "source": [ |
| #86 | "elon_bot.query(\"How many companies does Elon Musk run?\")" |
| #87 | ] |
| #88 | } |
| #89 | ], |
| #90 | "metadata": { |
| #91 | "kernelspec": { |
| #92 | "display_name": "Python 3", |
| #93 | "language": "python", |
| #94 | "name": "python3" |
| #95 | }, |
| #96 | "language_info": { |
| #97 | "codemirror_mode": { |
| #98 | "name": "ipython", |
| #99 | "version": 3 |
| #100 | }, |
| #101 | "file_extension": ".py", |
| #102 | "mimetype": "text/x-python", |
| #103 | "name": "python", |
| #104 | "nbconvert_exporter": "python", |
| #105 | "pygments_lexer": "ipython3", |
| #106 | "version": "3.8.8" |
| #107 | } |
| #108 | }, |
| #109 | "nbformat": 4, |
| #110 | "nbformat_minor": 5 |
| #111 | } |
| #112 |