Spaces:
No application file
No application file
Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .chainlit/config.toml +97 -0
- .chainlit/translations/en-US.json +155 -0
- .chainlit/translations/pt-BR.json +155 -0
- .gitattributes +2 -0
- .github/ISSUE_TEMPLATE/bug_report.yml +41 -0
- .github/ISSUE_TEMPLATE/config.yml +8 -0
- .github/ISSUE_TEMPLATE/documentation_issue.yml +11 -0
- .github/ISSUE_TEMPLATE/feature_request.yml +23 -0
- .github/PULL_REQUEST_TEMPLATE.md +41 -0
- .github/workflows/cd.yml +40 -0
- .github/workflows/ci.yml +53 -0
- .gitignore +181 -0
- .pre-commit-config.yaml +20 -0
- CITATION.cff +8 -0
- CONTRIBUTING.md +74 -0
- LICENSE +201 -0
- Makefile +52 -0
- README.md +131 -8
- chainlit.md +14 -0
- config.yaml +17 -0
- configs/anthropic.yaml +8 -0
- configs/azure_openai.yaml +19 -0
- configs/chroma.yaml +24 -0
- configs/chunker.yaml +4 -0
- configs/cohere.yaml +7 -0
- configs/full-stack.yaml +40 -0
- configs/google.yaml +13 -0
- configs/gpt4.yaml +8 -0
- configs/gpt4all.yaml +11 -0
- configs/huggingface.yaml +8 -0
- configs/jina.yaml +7 -0
- configs/llama2.yaml +8 -0
- configs/ollama.yaml +12 -0
- configs/opensearch.yaml +33 -0
- configs/opensource.yaml +25 -0
- configs/pinecone.yaml +6 -0
- configs/pipeline.yaml +26 -0
- configs/together.yaml +6 -0
- configs/vertexai.yaml +6 -0
- configs/vllm.yaml +14 -0
- configs/weaviate.yaml +4 -0
- docs/Makefile +10 -0
- docs/README.md +25 -0
- docs/_snippets/get-help.mdx +11 -0
- docs/_snippets/missing-data-source-tip.mdx +19 -0
- docs/_snippets/missing-llm-tip.mdx +16 -0
- docs/_snippets/missing-vector-db-tip.mdx +18 -0
- docs/api-reference/advanced/configuration.mdx +241 -0
- docs/api-reference/app/add.mdx +44 -0
- docs/api-reference/app/chat.mdx +146 -0
.chainlit/config.toml
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[project]
|
| 2 |
+
# Whether to enable telemetry (default: true). No personal data is collected.
|
| 3 |
+
enable_telemetry = true
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
# List of environment variables to be provided by each user to use the app.
|
| 7 |
+
user_env = []
|
| 8 |
+
|
| 9 |
+
# Duration (in seconds) during which the session is saved when the connection is lost
|
| 10 |
+
session_timeout = 3600
|
| 11 |
+
|
| 12 |
+
# Enable third parties caching (e.g LangChain cache)
|
| 13 |
+
cache = false
|
| 14 |
+
|
| 15 |
+
# Authorized origins
|
| 16 |
+
allow_origins = ["*"]
|
| 17 |
+
|
| 18 |
+
# Follow symlink for asset mount (see https://github.com/Chainlit/chainlit/issues/317)
|
| 19 |
+
# follow_symlink = false
|
| 20 |
+
|
| 21 |
+
[features]
|
| 22 |
+
# Show the prompt playground
|
| 23 |
+
prompt_playground = true
|
| 24 |
+
|
| 25 |
+
# Process and display HTML in messages. This can be a security risk (see https://stackoverflow.com/questions/19603097/why-is-it-dangerous-to-render-user-generated-html-or-javascript)
|
| 26 |
+
unsafe_allow_html = false
|
| 27 |
+
|
| 28 |
+
# Process and display mathematical expressions. This can clash with "$" characters in messages.
|
| 29 |
+
latex = false
|
| 30 |
+
|
| 31 |
+
# Authorize users to upload files with messages
|
| 32 |
+
multi_modal = true
|
| 33 |
+
|
| 34 |
+
# Allows user to use speech to text
|
| 35 |
+
[features.speech_to_text]
|
| 36 |
+
enabled = false
|
| 37 |
+
# See all languages here https://github.com/JamesBrill/react-speech-recognition/blob/HEAD/docs/API.md#language-string
|
| 38 |
+
# language = "en-US"
|
| 39 |
+
|
| 40 |
+
[UI]
|
| 41 |
+
# Name of the app and chatbot.
|
| 42 |
+
name = "Chatbot"
|
| 43 |
+
|
| 44 |
+
# Show the readme while the thread is empty.
|
| 45 |
+
show_readme_as_default = true
|
| 46 |
+
|
| 47 |
+
# Description of the app and chatbot. This is used for HTML tags.
|
| 48 |
+
# description = ""
|
| 49 |
+
|
| 50 |
+
# Large size content are by default collapsed for a cleaner ui
|
| 51 |
+
default_collapse_content = true
|
| 52 |
+
|
| 53 |
+
# The default value for the expand messages settings.
|
| 54 |
+
default_expand_messages = false
|
| 55 |
+
|
| 56 |
+
# Hide the chain of thought details from the user in the UI.
|
| 57 |
+
hide_cot = false
|
| 58 |
+
|
| 59 |
+
# Link to your github repo. This will add a github button in the UI's header.
|
| 60 |
+
# github = ""
|
| 61 |
+
|
| 62 |
+
# Specify a CSS file that can be used to customize the user interface.
|
| 63 |
+
# The CSS file can be served from the public directory or via an external link.
|
| 64 |
+
# custom_css = "/public/test.css"
|
| 65 |
+
|
| 66 |
+
# Specify a Javascript file that can be used to customize the user interface.
|
| 67 |
+
# The Javascript file can be served from the public directory.
|
| 68 |
+
# custom_js = "/public/test.js"
|
| 69 |
+
|
| 70 |
+
# Specify a custom font url.
|
| 71 |
+
# custom_font = "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap"
|
| 72 |
+
|
| 73 |
+
# Override default MUI light theme. (Check theme.ts)
|
| 74 |
+
[UI.theme]
|
| 75 |
+
#font_family = "Inter, sans-serif"
|
| 76 |
+
[UI.theme.light]
|
| 77 |
+
#background = "#FAFAFA"
|
| 78 |
+
#paper = "#FFFFFF"
|
| 79 |
+
|
| 80 |
+
[UI.theme.light.primary]
|
| 81 |
+
#main = "#F80061"
|
| 82 |
+
#dark = "#980039"
|
| 83 |
+
#light = "#FFE7EB"
|
| 84 |
+
|
| 85 |
+
# Override default MUI dark theme. (Check theme.ts)
|
| 86 |
+
[UI.theme.dark]
|
| 87 |
+
#background = "#FAFAFA"
|
| 88 |
+
#paper = "#FFFFFF"
|
| 89 |
+
|
| 90 |
+
[UI.theme.dark.primary]
|
| 91 |
+
#main = "#F80061"
|
| 92 |
+
#dark = "#980039"
|
| 93 |
+
#light = "#FFE7EB"
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
[meta]
|
| 97 |
+
generated_by = "1.0.301"
|
.chainlit/translations/en-US.json
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"components": {
|
| 3 |
+
"atoms": {
|
| 4 |
+
"buttons": {
|
| 5 |
+
"userButton": {
|
| 6 |
+
"menu": {
|
| 7 |
+
"settings": "Settings",
|
| 8 |
+
"settingsKey": "S",
|
| 9 |
+
"APIKeys": "API Keys",
|
| 10 |
+
"logout": "Logout"
|
| 11 |
+
}
|
| 12 |
+
}
|
| 13 |
+
}
|
| 14 |
+
},
|
| 15 |
+
"molecules": {
|
| 16 |
+
"newChatButton": {
|
| 17 |
+
"newChat": "New Chat"
|
| 18 |
+
},
|
| 19 |
+
"tasklist": {
|
| 20 |
+
"TaskList": {
|
| 21 |
+
"title": "\ud83d\uddd2\ufe0f Task List",
|
| 22 |
+
"loading": "Loading...",
|
| 23 |
+
"error": "An error occured"
|
| 24 |
+
}
|
| 25 |
+
},
|
| 26 |
+
"attachments": {
|
| 27 |
+
"cancelUpload": "Cancel upload",
|
| 28 |
+
"removeAttachment": "Remove attachment"
|
| 29 |
+
},
|
| 30 |
+
"newChatDialog": {
|
| 31 |
+
"createNewChat": "Create new chat?",
|
| 32 |
+
"clearChat": "This will clear the current messages and start a new chat.",
|
| 33 |
+
"cancel": "Cancel",
|
| 34 |
+
"confirm": "Confirm"
|
| 35 |
+
},
|
| 36 |
+
"settingsModal": {
|
| 37 |
+
"expandMessages": "Expand Messages",
|
| 38 |
+
"hideChainOfThought": "Hide Chain of Thought",
|
| 39 |
+
"darkMode": "Dark Mode"
|
| 40 |
+
}
|
| 41 |
+
},
|
| 42 |
+
"organisms": {
|
| 43 |
+
"chat": {
|
| 44 |
+
"history": {
|
| 45 |
+
"index": {
|
| 46 |
+
"lastInputs": "Last Inputs",
|
| 47 |
+
"noInputs": "Such empty...",
|
| 48 |
+
"loading": "Loading..."
|
| 49 |
+
}
|
| 50 |
+
},
|
| 51 |
+
"inputBox": {
|
| 52 |
+
"input": {
|
| 53 |
+
"placeholder": "Type your message here..."
|
| 54 |
+
},
|
| 55 |
+
"speechButton": {
|
| 56 |
+
"start": "Start recording",
|
| 57 |
+
"stop": "Stop recording"
|
| 58 |
+
},
|
| 59 |
+
"SubmitButton": {
|
| 60 |
+
"sendMessage": "Send message",
|
| 61 |
+
"stopTask": "Stop Task"
|
| 62 |
+
},
|
| 63 |
+
"UploadButton": {
|
| 64 |
+
"attachFiles": "Attach files"
|
| 65 |
+
},
|
| 66 |
+
"waterMark": {
|
| 67 |
+
"text": "Built with"
|
| 68 |
+
}
|
| 69 |
+
},
|
| 70 |
+
"Messages": {
|
| 71 |
+
"index": {
|
| 72 |
+
"running": "Running",
|
| 73 |
+
"executedSuccessfully": "executed successfully",
|
| 74 |
+
"failed": "failed",
|
| 75 |
+
"feedbackUpdated": "Feedback updated",
|
| 76 |
+
"updating": "Updating"
|
| 77 |
+
}
|
| 78 |
+
},
|
| 79 |
+
"dropScreen": {
|
| 80 |
+
"dropYourFilesHere": "Drop your files here"
|
| 81 |
+
},
|
| 82 |
+
"index": {
|
| 83 |
+
"failedToUpload": "Failed to upload",
|
| 84 |
+
"cancelledUploadOf": "Cancelled upload of",
|
| 85 |
+
"couldNotReachServer": "Could not reach the server",
|
| 86 |
+
"continuingChat": "Continuing previous chat"
|
| 87 |
+
},
|
| 88 |
+
"settings": {
|
| 89 |
+
"settingsPanel": "Settings panel",
|
| 90 |
+
"reset": "Reset",
|
| 91 |
+
"cancel": "Cancel",
|
| 92 |
+
"confirm": "Confirm"
|
| 93 |
+
}
|
| 94 |
+
},
|
| 95 |
+
"threadHistory": {
|
| 96 |
+
"sidebar": {
|
| 97 |
+
"filters": {
|
| 98 |
+
"FeedbackSelect": {
|
| 99 |
+
"feedbackAll": "Feedback: All",
|
| 100 |
+
"feedbackPositive": "Feedback: Positive",
|
| 101 |
+
"feedbackNegative": "Feedback: Negative"
|
| 102 |
+
},
|
| 103 |
+
"SearchBar": {
|
| 104 |
+
"search": "Search"
|
| 105 |
+
}
|
| 106 |
+
},
|
| 107 |
+
"DeleteThreadButton": {
|
| 108 |
+
"confirmMessage": "This will delete the thread as well as it's messages and elements.",
|
| 109 |
+
"cancel": "Cancel",
|
| 110 |
+
"confirm": "Confirm",
|
| 111 |
+
"deletingChat": "Deleting chat",
|
| 112 |
+
"chatDeleted": "Chat deleted"
|
| 113 |
+
},
|
| 114 |
+
"index": {
|
| 115 |
+
"pastChats": "Past Chats"
|
| 116 |
+
},
|
| 117 |
+
"ThreadList": {
|
| 118 |
+
"empty": "Empty..."
|
| 119 |
+
},
|
| 120 |
+
"TriggerButton": {
|
| 121 |
+
"closeSidebar": "Close sidebar",
|
| 122 |
+
"openSidebar": "Open sidebar"
|
| 123 |
+
}
|
| 124 |
+
},
|
| 125 |
+
"Thread": {
|
| 126 |
+
"backToChat": "Go back to chat",
|
| 127 |
+
"chatCreatedOn": "This chat was created on"
|
| 128 |
+
}
|
| 129 |
+
},
|
| 130 |
+
"header": {
|
| 131 |
+
"chat": "Chat",
|
| 132 |
+
"readme": "Readme"
|
| 133 |
+
}
|
| 134 |
+
}
|
| 135 |
+
},
|
| 136 |
+
"hooks": {
|
| 137 |
+
"useLLMProviders": {
|
| 138 |
+
"failedToFetchProviders": "Failed to fetch providers:"
|
| 139 |
+
}
|
| 140 |
+
},
|
| 141 |
+
"pages": {
|
| 142 |
+
"Design": {},
|
| 143 |
+
"Env": {
|
| 144 |
+
"savedSuccessfully": "Saved successfully",
|
| 145 |
+
"requiredApiKeys": "Required API Keys",
|
| 146 |
+
"requiredApiKeysInfo": "To use this app, the following API keys are required. The keys are stored on your device's local storage."
|
| 147 |
+
},
|
| 148 |
+
"Page": {
|
| 149 |
+
"notPartOfProject": "You are not part of this project."
|
| 150 |
+
},
|
| 151 |
+
"ResumeButton": {
|
| 152 |
+
"resumeChat": "Resume Chat"
|
| 153 |
+
}
|
| 154 |
+
}
|
| 155 |
+
}
|
.chainlit/translations/pt-BR.json
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"components": {
|
| 3 |
+
"atoms": {
|
| 4 |
+
"buttons": {
|
| 5 |
+
"userButton": {
|
| 6 |
+
"menu": {
|
| 7 |
+
"settings": "Configura\u00e7\u00f5es",
|
| 8 |
+
"settingsKey": "S",
|
| 9 |
+
"APIKeys": "Chaves de API",
|
| 10 |
+
"logout": "Sair"
|
| 11 |
+
}
|
| 12 |
+
}
|
| 13 |
+
}
|
| 14 |
+
},
|
| 15 |
+
"molecules": {
|
| 16 |
+
"newChatButton": {
|
| 17 |
+
"newChat": "Nova Conversa"
|
| 18 |
+
},
|
| 19 |
+
"tasklist": {
|
| 20 |
+
"TaskList": {
|
| 21 |
+
"title": "\ud83d\uddd2\ufe0f Lista de Tarefas",
|
| 22 |
+
"loading": "Carregando...",
|
| 23 |
+
"error": "Ocorreu um erro"
|
| 24 |
+
}
|
| 25 |
+
},
|
| 26 |
+
"attachments": {
|
| 27 |
+
"cancelUpload": "Cancelar envio",
|
| 28 |
+
"removeAttachment": "Remover anexo"
|
| 29 |
+
},
|
| 30 |
+
"newChatDialog": {
|
| 31 |
+
"createNewChat": "Criar novo chat?",
|
| 32 |
+
"clearChat": "Isso limpar\u00e1 as mensagens atuais e iniciar\u00e1 uma nova conversa.",
|
| 33 |
+
"cancel": "Cancelar",
|
| 34 |
+
"confirm": "Confirmar"
|
| 35 |
+
},
|
| 36 |
+
"settingsModal": {
|
| 37 |
+
"expandMessages": "Expandir Mensagens",
|
| 38 |
+
"hideChainOfThought": "Esconder Sequ\u00eancia de Pensamento",
|
| 39 |
+
"darkMode": "Modo Escuro"
|
| 40 |
+
}
|
| 41 |
+
},
|
| 42 |
+
"organisms": {
|
| 43 |
+
"chat": {
|
| 44 |
+
"history": {
|
| 45 |
+
"index": {
|
| 46 |
+
"lastInputs": "\u00daltimas Entradas",
|
| 47 |
+
"noInputs": "Vazio...",
|
| 48 |
+
"loading": "Carregando..."
|
| 49 |
+
}
|
| 50 |
+
},
|
| 51 |
+
"inputBox": {
|
| 52 |
+
"input": {
|
| 53 |
+
"placeholder": "Digite sua mensagem aqui..."
|
| 54 |
+
},
|
| 55 |
+
"speechButton": {
|
| 56 |
+
"start": "Iniciar grava\u00e7\u00e3o",
|
| 57 |
+
"stop": "Parar grava\u00e7\u00e3o"
|
| 58 |
+
},
|
| 59 |
+
"SubmitButton": {
|
| 60 |
+
"sendMessage": "Enviar mensagem",
|
| 61 |
+
"stopTask": "Parar Tarefa"
|
| 62 |
+
},
|
| 63 |
+
"UploadButton": {
|
| 64 |
+
"attachFiles": "Anexar arquivos"
|
| 65 |
+
},
|
| 66 |
+
"waterMark": {
|
| 67 |
+
"text": "Constru\u00eddo com"
|
| 68 |
+
}
|
| 69 |
+
},
|
| 70 |
+
"Messages": {
|
| 71 |
+
"index": {
|
| 72 |
+
"running": "Executando",
|
| 73 |
+
"executedSuccessfully": "executado com sucesso",
|
| 74 |
+
"failed": "falhou",
|
| 75 |
+
"feedbackUpdated": "Feedback atualizado",
|
| 76 |
+
"updating": "Atualizando"
|
| 77 |
+
}
|
| 78 |
+
},
|
| 79 |
+
"dropScreen": {
|
| 80 |
+
"dropYourFilesHere": "Solte seus arquivos aqui"
|
| 81 |
+
},
|
| 82 |
+
"index": {
|
| 83 |
+
"failedToUpload": "Falha ao enviar",
|
| 84 |
+
"cancelledUploadOf": "Envio cancelado de",
|
| 85 |
+
"couldNotReachServer": "N\u00e3o foi poss\u00edvel conectar ao servidor",
|
| 86 |
+
"continuingChat": "Continuando o chat anterior"
|
| 87 |
+
},
|
| 88 |
+
"settings": {
|
| 89 |
+
"settingsPanel": "Painel de Configura\u00e7\u00f5es",
|
| 90 |
+
"reset": "Redefinir",
|
| 91 |
+
"cancel": "Cancelar",
|
| 92 |
+
"confirm": "Confirmar"
|
| 93 |
+
}
|
| 94 |
+
},
|
| 95 |
+
"threadHistory": {
|
| 96 |
+
"sidebar": {
|
| 97 |
+
"filters": {
|
| 98 |
+
"FeedbackSelect": {
|
| 99 |
+
"feedbackAll": "Feedback: Todos",
|
| 100 |
+
"feedbackPositive": "Feedback: Positivo",
|
| 101 |
+
"feedbackNegative": "Feedback: Negativo"
|
| 102 |
+
},
|
| 103 |
+
"SearchBar": {
|
| 104 |
+
"search": "Buscar"
|
| 105 |
+
}
|
| 106 |
+
},
|
| 107 |
+
"DeleteThreadButton": {
|
| 108 |
+
"confirmMessage": "Isso deletar\u00e1 a conversa, assim como suas mensagens e elementos.",
|
| 109 |
+
"cancel": "Cancelar",
|
| 110 |
+
"confirm": "Confirmar",
|
| 111 |
+
"deletingChat": "Deletando conversa",
|
| 112 |
+
"chatDeleted": "Conversa deletada"
|
| 113 |
+
},
|
| 114 |
+
"index": {
|
| 115 |
+
"pastChats": "Conversas Anteriores"
|
| 116 |
+
},
|
| 117 |
+
"ThreadList": {
|
| 118 |
+
"empty": "Vazio..."
|
| 119 |
+
},
|
| 120 |
+
"TriggerButton": {
|
| 121 |
+
"closeSidebar": "Fechar barra lateral",
|
| 122 |
+
"openSidebar": "Abrir barra lateral"
|
| 123 |
+
}
|
| 124 |
+
},
|
| 125 |
+
"Thread": {
|
| 126 |
+
"backToChat": "Voltar para a conversa",
|
| 127 |
+
"chatCreatedOn": "Esta conversa foi criada em"
|
| 128 |
+
}
|
| 129 |
+
},
|
| 130 |
+
"header": {
|
| 131 |
+
"chat": "Conversa",
|
| 132 |
+
"readme": "Leia-me"
|
| 133 |
+
}
|
| 134 |
+
},
|
| 135 |
+
"hooks": {
|
| 136 |
+
"useLLMProviders": {
|
| 137 |
+
"failedToFetchProviders": "Falha ao buscar provedores:"
|
| 138 |
+
}
|
| 139 |
+
},
|
| 140 |
+
"pages": {
|
| 141 |
+
"Design": {},
|
| 142 |
+
"Env": {
|
| 143 |
+
"savedSuccessfully": "Salvo com sucesso",
|
| 144 |
+
"requiredApiKeys": "Chaves de API necess\u00e1rias",
|
| 145 |
+
"requiredApiKeysInfo": "Para usar este aplicativo, as seguintes chaves de API s\u00e3o necess\u00e1rias. As chaves s\u00e3o armazenadas localmente em seu dispositivo."
|
| 146 |
+
},
|
| 147 |
+
"Page": {
|
| 148 |
+
"notPartOfProject": "Voc\u00ea n\u00e3o faz parte deste projeto."
|
| 149 |
+
},
|
| 150 |
+
"ResumeButton": {
|
| 151 |
+
"resumeChat": "Continuar Conversa"
|
| 152 |
+
}
|
| 153 |
+
}
|
| 154 |
+
}
|
| 155 |
+
}
|
.gitattributes
CHANGED
|
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
docs/images/cover.gif filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
docs/images/slack-ai.png filter=lfs diff=lfs merge=lfs -text
|
.github/ISSUE_TEMPLATE/bug_report.yml
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: 🐛 Bug Report
|
| 2 |
+
description: Create a report to help us reproduce and fix the bug
|
| 3 |
+
|
| 4 |
+
body:
|
| 5 |
+
- type: markdown
|
| 6 |
+
attributes:
|
| 7 |
+
value: >
|
| 8 |
+
#### Before submitting a bug, please make sure the issue hasn't been already addressed by searching through [the existing and past issues](https://github.com/embedchain/embedchain/issues?q=is%3Aissue+sort%3Acreated-desc+).
|
| 9 |
+
- type: textarea
|
| 10 |
+
attributes:
|
| 11 |
+
label: 🐛 Describe the bug
|
| 12 |
+
description: |
|
| 13 |
+
Please provide a clear and concise description of what the bug is.
|
| 14 |
+
|
| 15 |
+
If relevant, add a minimal example so that we can reproduce the error by running the code. It is very important for the snippet to be as succinct (minimal) as possible, so please take time to trim down any irrelevant code to help us debug efficiently. We are going to copy-paste your code and we expect to get the same result as you did: avoid any external data, and include the relevant imports, etc. For example:
|
| 16 |
+
|
| 17 |
+
```python
|
| 18 |
+
# All necessary imports at the beginning
|
| 19 |
+
import embedchain as ec
|
| 20 |
+
# Your code goes here
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
Please also paste or describe the results you observe instead of the expected results. If you observe an error, please paste the error message including the **full** traceback of the exception. It may be relevant to wrap error messages in ```` ```triple quotes blocks``` ````.
|
| 26 |
+
placeholder: |
|
| 27 |
+
A clear and concise description of what the bug is.
|
| 28 |
+
|
| 29 |
+
```python
|
| 30 |
+
Sample code to reproduce the problem
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
```
|
| 34 |
+
The error message you got, with the full traceback.
|
| 35 |
+
````
|
| 36 |
+
validations:
|
| 37 |
+
required: true
|
| 38 |
+
- type: markdown
|
| 39 |
+
attributes:
|
| 40 |
+
value: >
|
| 41 |
+
Thanks for contributing 🎉!
|
.github/ISSUE_TEMPLATE/config.yml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
blank_issues_enabled: true
|
| 2 |
+
contact_links:
|
| 3 |
+
- name: 1-on-1 Session
|
| 4 |
+
url: https://cal.com/taranjeetio/ec
|
| 5 |
+
about: Speak directly with Taranjeet, the founder, to discuss issues, share feedback, or explore improvements for Embedchain
|
| 6 |
+
- name: Discord
|
| 7 |
+
url: https://discord.gg/6PzXDgEjG5
|
| 8 |
+
about: General community discussions
|
.github/ISSUE_TEMPLATE/documentation_issue.yml
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Documentation
|
| 2 |
+
description: Report an issue related to the Embedchain docs.
|
| 3 |
+
title: "DOC: <Please write a comprehensive title after the 'DOC: ' prefix>"
|
| 4 |
+
|
| 5 |
+
body:
|
| 6 |
+
- type: textarea
|
| 7 |
+
attributes:
|
| 8 |
+
label: "Issue with current documentation:"
|
| 9 |
+
description: >
|
| 10 |
+
Please make sure to leave a reference to the document/code you're
|
| 11 |
+
referring to.
|
.github/ISSUE_TEMPLATE/feature_request.yml
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: 🚀 Feature request
|
| 2 |
+
description: Submit a proposal/request for a new Embedchain feature
|
| 3 |
+
|
| 4 |
+
body:
|
| 5 |
+
- type: textarea
|
| 6 |
+
id: feature-request
|
| 7 |
+
attributes:
|
| 8 |
+
label: 🚀 The feature
|
| 9 |
+
description: >
|
| 10 |
+
A clear and concise description of the feature proposal
|
| 11 |
+
validations:
|
| 12 |
+
required: true
|
| 13 |
+
- type: textarea
|
| 14 |
+
attributes:
|
| 15 |
+
label: Motivation, pitch
|
| 16 |
+
description: >
|
| 17 |
+
Please outline the motivation for the proposal. Is your feature request related to a specific problem? e.g., *"I'm working on X and would like Y to be possible"*. If this is related to another GitHub issue, please link here too.
|
| 18 |
+
validations:
|
| 19 |
+
required: true
|
| 20 |
+
- type: markdown
|
| 21 |
+
attributes:
|
| 22 |
+
value: >
|
| 23 |
+
Thanks for contributing 🎉!
|
.github/PULL_REQUEST_TEMPLATE.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## Description
|
| 2 |
+
|
| 3 |
+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
|
| 4 |
+
|
| 5 |
+
Fixes # (issue)
|
| 6 |
+
|
| 7 |
+
## Type of change
|
| 8 |
+
|
| 9 |
+
Please delete options that are not relevant.
|
| 10 |
+
|
| 11 |
+
- [ ] Bug fix (non-breaking change which fixes an issue)
|
| 12 |
+
- [ ] New feature (non-breaking change which adds functionality)
|
| 13 |
+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
| 14 |
+
- [ ] Refactor (does not change functionality, e.g. code style improvements, linting)
|
| 15 |
+
- [ ] Documentation update
|
| 16 |
+
|
| 17 |
+
## How Has This Been Tested?
|
| 18 |
+
|
| 19 |
+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
|
| 20 |
+
|
| 21 |
+
Please delete options that are not relevant.
|
| 22 |
+
|
| 23 |
+
- [ ] Unit Test
|
| 24 |
+
- [ ] Test Script (please provide)
|
| 25 |
+
|
| 26 |
+
## Checklist:
|
| 27 |
+
|
| 28 |
+
- [ ] My code follows the style guidelines of this project
|
| 29 |
+
- [ ] I have performed a self-review of my own code
|
| 30 |
+
- [ ] I have commented my code, particularly in hard-to-understand areas
|
| 31 |
+
- [ ] I have made corresponding changes to the documentation
|
| 32 |
+
- [ ] My changes generate no new warnings
|
| 33 |
+
- [ ] I have added tests that prove my fix is effective or that my feature works
|
| 34 |
+
- [ ] New and existing unit tests pass locally with my changes
|
| 35 |
+
- [ ] Any dependent changes have been merged and published in downstream modules
|
| 36 |
+
- [ ] I have checked my code and corrected any misspellings
|
| 37 |
+
|
| 38 |
+
## Maintainer Checklist
|
| 39 |
+
|
| 40 |
+
- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
|
| 41 |
+
- [ ] Made sure Checks passed
|
.github/workflows/cd.yml
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
release:
|
| 5 |
+
types: [published] # This will trigger the workflow when you create a new release
|
| 6 |
+
|
| 7 |
+
jobs:
|
| 8 |
+
build-n-publish:
|
| 9 |
+
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
|
| 10 |
+
runs-on: ubuntu-latest
|
| 11 |
+
permissions:
|
| 12 |
+
# IMPORTANT: this permission is mandatory for trusted publishing
|
| 13 |
+
id-token: write
|
| 14 |
+
steps:
|
| 15 |
+
- uses: actions/checkout@v2
|
| 16 |
+
|
| 17 |
+
- name: Set up Python
|
| 18 |
+
uses: actions/setup-python@v2
|
| 19 |
+
with:
|
| 20 |
+
python-version: '3.11'
|
| 21 |
+
|
| 22 |
+
- name: Install Poetry
|
| 23 |
+
run: |
|
| 24 |
+
curl -sSL https://install.python-poetry.org | python3 -
|
| 25 |
+
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
| 26 |
+
|
| 27 |
+
- name: Install dependencies
|
| 28 |
+
run: poetry install
|
| 29 |
+
|
| 30 |
+
- name: Build a binary wheel and a source tarball
|
| 31 |
+
run: poetry build
|
| 32 |
+
|
| 33 |
+
- name: Publish distribution 📦 to Test PyPI
|
| 34 |
+
uses: pypa/gh-action-pypi-publish@release/v1
|
| 35 |
+
with:
|
| 36 |
+
repository_url: https://test.pypi.org/legacy/
|
| 37 |
+
|
| 38 |
+
- name: Publish distribution 📦 to PyPI
|
| 39 |
+
if: startsWith(github.ref, 'refs/tags')
|
| 40 |
+
uses: pypa/gh-action-pypi-publish@release/v1
|
.github/workflows/ci.yml
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: ci
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
push:
|
| 5 |
+
branches: [main]
|
| 6 |
+
paths:
|
| 7 |
+
- 'embedchain/**'
|
| 8 |
+
- 'tests/**'
|
| 9 |
+
- 'examples/**'
|
| 10 |
+
pull_request:
|
| 11 |
+
paths:
|
| 12 |
+
- 'embedchain/**'
|
| 13 |
+
- 'tests/**'
|
| 14 |
+
- 'examples/**'
|
| 15 |
+
|
| 16 |
+
jobs:
|
| 17 |
+
build:
|
| 18 |
+
runs-on: ubuntu-latest
|
| 19 |
+
strategy:
|
| 20 |
+
matrix:
|
| 21 |
+
python-version: ["3.9", "3.10", "3.11"]
|
| 22 |
+
|
| 23 |
+
steps:
|
| 24 |
+
- uses: actions/checkout@v3
|
| 25 |
+
- name: Set up Python ${{ matrix.python-version }}
|
| 26 |
+
uses: actions/setup-python@v4
|
| 27 |
+
with:
|
| 28 |
+
python-version: ${{ matrix.python-version }}
|
| 29 |
+
- name: Install poetry
|
| 30 |
+
uses: snok/install-poetry@v1
|
| 31 |
+
with:
|
| 32 |
+
version: 1.4.2
|
| 33 |
+
virtualenvs-create: true
|
| 34 |
+
virtualenvs-in-project: true
|
| 35 |
+
- name: Load cached venv
|
| 36 |
+
id: cached-poetry-dependencies
|
| 37 |
+
uses: actions/cache@v2
|
| 38 |
+
with:
|
| 39 |
+
path: .venv
|
| 40 |
+
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
|
| 41 |
+
- name: Install dependencies
|
| 42 |
+
run: make install_all
|
| 43 |
+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
| 44 |
+
- name: Lint with ruff
|
| 45 |
+
run: make lint
|
| 46 |
+
- name: Run tests and generate coverage report
|
| 47 |
+
run: make coverage
|
| 48 |
+
- name: Upload coverage reports to Codecov
|
| 49 |
+
uses: codecov/codecov-action@v3
|
| 50 |
+
with:
|
| 51 |
+
file: coverage.xml
|
| 52 |
+
env:
|
| 53 |
+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
.gitignore
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Byte-compiled / optimized / DLL files
|
| 2 |
+
__pycache__/
|
| 3 |
+
*.py[cod]
|
| 4 |
+
*$py.class
|
| 5 |
+
|
| 6 |
+
# C extensions
|
| 7 |
+
*.so
|
| 8 |
+
|
| 9 |
+
# Distribution / packaging
|
| 10 |
+
.Python
|
| 11 |
+
build/
|
| 12 |
+
develop-eggs/
|
| 13 |
+
dist/
|
| 14 |
+
downloads/
|
| 15 |
+
eggs/
|
| 16 |
+
.eggs/
|
| 17 |
+
lib/
|
| 18 |
+
lib64/
|
| 19 |
+
parts/
|
| 20 |
+
sdist/
|
| 21 |
+
var/
|
| 22 |
+
wheels/
|
| 23 |
+
share/python-wheels/
|
| 24 |
+
*.egg-info/
|
| 25 |
+
.installed.cfg
|
| 26 |
+
*.egg
|
| 27 |
+
MANIFEST
|
| 28 |
+
|
| 29 |
+
# PyInstaller
|
| 30 |
+
# Usually these files are written by a python script from a template
|
| 31 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
| 32 |
+
*.manifest
|
| 33 |
+
*.spec
|
| 34 |
+
|
| 35 |
+
# Installer logs
|
| 36 |
+
pip-log.txt
|
| 37 |
+
pip-delete-this-directory.txt
|
| 38 |
+
|
| 39 |
+
# Unit test / coverage reports
|
| 40 |
+
htmlcov/
|
| 41 |
+
.tox/
|
| 42 |
+
.nox/
|
| 43 |
+
.coverage
|
| 44 |
+
.coverage.*
|
| 45 |
+
.cache
|
| 46 |
+
nosetests.xml
|
| 47 |
+
coverage.xml
|
| 48 |
+
*.cover
|
| 49 |
+
*.py,cover
|
| 50 |
+
.hypothesis/
|
| 51 |
+
.pytest_cache/
|
| 52 |
+
cover/
|
| 53 |
+
|
| 54 |
+
# Translations
|
| 55 |
+
*.mo
|
| 56 |
+
*.pot
|
| 57 |
+
|
| 58 |
+
# Django stuff:
|
| 59 |
+
*.log
|
| 60 |
+
local_settings.py
|
| 61 |
+
db.sqlite3
|
| 62 |
+
db.sqlite3-journal
|
| 63 |
+
|
| 64 |
+
# Flask stuff:
|
| 65 |
+
instance/
|
| 66 |
+
.webassets-cache
|
| 67 |
+
|
| 68 |
+
# Scrapy stuff:
|
| 69 |
+
.scrapy
|
| 70 |
+
|
| 71 |
+
# Sphinx documentation
|
| 72 |
+
docs/_build/
|
| 73 |
+
|
| 74 |
+
# PyBuilder
|
| 75 |
+
.pybuilder/
|
| 76 |
+
target/
|
| 77 |
+
|
| 78 |
+
# Jupyter Notebook
|
| 79 |
+
|
| 80 |
+
# IPython
|
| 81 |
+
profile_default/
|
| 82 |
+
ipython_config.py
|
| 83 |
+
|
| 84 |
+
# pyenv
|
| 85 |
+
# For a library or package, you might want to ignore these files since the code is
|
| 86 |
+
# intended to run in multiple environments; otherwise, check them in:
|
| 87 |
+
# .python-version
|
| 88 |
+
|
| 89 |
+
# pipenv
|
| 90 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
| 91 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
| 92 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
| 93 |
+
# install all needed dependencies.
|
| 94 |
+
#Pipfile.lock
|
| 95 |
+
|
| 96 |
+
# poetry
|
| 97 |
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
| 98 |
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
| 99 |
+
# commonly ignored for libraries.
|
| 100 |
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
| 101 |
+
#poetry.lock
|
| 102 |
+
|
| 103 |
+
# pdm
|
| 104 |
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
| 105 |
+
#pdm.lock
|
| 106 |
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
| 107 |
+
# in version control.
|
| 108 |
+
# https://pdm.fming.dev/#use-with-ide
|
| 109 |
+
.pdm.toml
|
| 110 |
+
|
| 111 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
| 112 |
+
__pypackages__/
|
| 113 |
+
|
| 114 |
+
# Celery stuff
|
| 115 |
+
celerybeat-schedule
|
| 116 |
+
celerybeat.pid
|
| 117 |
+
|
| 118 |
+
# SageMath parsed files
|
| 119 |
+
*.sage.py
|
| 120 |
+
|
| 121 |
+
# Environments
|
| 122 |
+
.env
|
| 123 |
+
.venv
|
| 124 |
+
env/
|
| 125 |
+
venv/
|
| 126 |
+
ENV/
|
| 127 |
+
env.bak/
|
| 128 |
+
venv.bak/
|
| 129 |
+
pyenv/
|
| 130 |
+
|
| 131 |
+
# Spyder project settings
|
| 132 |
+
.spyderproject
|
| 133 |
+
.spyproject
|
| 134 |
+
|
| 135 |
+
# Rope project settings
|
| 136 |
+
.ropeproject
|
| 137 |
+
|
| 138 |
+
# mkdocs documentation
|
| 139 |
+
/site
|
| 140 |
+
|
| 141 |
+
# mypy
|
| 142 |
+
.mypy_cache/
|
| 143 |
+
.dmypy.json
|
| 144 |
+
dmypy.json
|
| 145 |
+
|
| 146 |
+
# Pyre type checker
|
| 147 |
+
.pyre/
|
| 148 |
+
|
| 149 |
+
# pytype static type analyzer
|
| 150 |
+
.pytype/
|
| 151 |
+
|
| 152 |
+
# Cython debug symbols
|
| 153 |
+
cython_debug/
|
| 154 |
+
|
| 155 |
+
# PyCharm
|
| 156 |
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
| 157 |
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
| 158 |
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
| 159 |
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
| 160 |
+
#.idea/
|
| 161 |
+
|
| 162 |
+
.ideas.md
|
| 163 |
+
.todos.md
|
| 164 |
+
|
| 165 |
+
# Database
|
| 166 |
+
db
|
| 167 |
+
test-db
|
| 168 |
+
!embedchain/core/db/
|
| 169 |
+
|
| 170 |
+
.vscode
|
| 171 |
+
.idea/
|
| 172 |
+
|
| 173 |
+
.DS_Store
|
| 174 |
+
|
| 175 |
+
notebooks/*.yaml
|
| 176 |
+
.ipynb_checkpoints/
|
| 177 |
+
|
| 178 |
+
!configs/*.yaml
|
| 179 |
+
|
| 180 |
+
# cache db
|
| 181 |
+
*.db
|
.pre-commit-config.yaml
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
repos:
|
| 2 |
+
- repo: https://github.com/psf/black
|
| 3 |
+
rev: 23.3.0
|
| 4 |
+
hooks:
|
| 5 |
+
- id: black
|
| 6 |
+
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
| 7 |
+
rev: 'v0.0.220'
|
| 8 |
+
hooks:
|
| 9 |
+
- id: ruff
|
| 10 |
+
name: ruff
|
| 11 |
+
# Respect `exclude` and `extend-exclude` settings.
|
| 12 |
+
args: ["--force-exclude"]
|
| 13 |
+
- repo: local
|
| 14 |
+
hooks:
|
| 15 |
+
- id: pytest-check
|
| 16 |
+
name: pytest-check
|
| 17 |
+
entry: poetry run pytest
|
| 18 |
+
language: system
|
| 19 |
+
pass_filenames: false
|
| 20 |
+
always_run: true
|
CITATION.cff
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
cff-version: 1.2.0
|
| 2 |
+
message: "If you use this software, please cite it as below."
|
| 3 |
+
authors:
|
| 4 |
+
- family-names: "Singh"
|
| 5 |
+
given-names: "Taranjeet"
|
| 6 |
+
title: "Embedchain"
|
| 7 |
+
date-released: 2023-06-20
|
| 8 |
+
url: "https://github.com/embedchain/embedchain"
|
CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Contributing to embedchain
|
| 2 |
+
|
| 3 |
+
Let us make contribution easy, collaborative and fun.
|
| 4 |
+
|
| 5 |
+
## Submit your Contribution through PR
|
| 6 |
+
|
| 7 |
+
To make a contribution, follow these steps:
|
| 8 |
+
|
| 9 |
+
1. Fork and clone this repository
|
| 10 |
+
2. Do the changes on your fork with dedicated feature branch `feature/f1`
|
| 11 |
+
3. If you modified the code (new feature or bug-fix), please add tests for it
|
| 12 |
+
4. Include proper documentation / docstring and examples to run the feature
|
| 13 |
+
5. Check the linting
|
| 14 |
+
6. Ensure that all tests pass
|
| 15 |
+
7. Submit a pull request
|
| 16 |
+
|
| 17 |
+
For more details about pull requests, please read [GitHub's guides](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request).
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
### 📦 Package manager
|
| 21 |
+
|
| 22 |
+
We use `poetry` as our package manager. You can install poetry by following the instructions [here](https://python-poetry.org/docs/#installation).
|
| 23 |
+
|
| 24 |
+
Please DO NOT use pip or conda to install the dependencies. Instead, use poetry:
|
| 25 |
+
|
| 26 |
+
```bash
|
| 27 |
+
poetry install --all-extras
|
| 28 |
+
or
|
| 29 |
+
poetry install --with dev
|
| 30 |
+
|
| 31 |
+
#activate
|
| 32 |
+
|
| 33 |
+
poetry shell
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
### 📌 Pre-commit
|
| 37 |
+
|
| 38 |
+
To ensure our standards, make sure to install pre-commit before starting to contribute.
|
| 39 |
+
|
| 40 |
+
```bash
|
| 41 |
+
pre-commit install
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
### 🧹 Linting
|
| 45 |
+
|
| 46 |
+
We use `ruff` to lint our code. You can run the linter by running the following command:
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
make lint
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
Make sure that the linter does not report any errors or warnings before submitting a pull request.
|
| 53 |
+
|
| 54 |
+
### Code Formatting with `black`
|
| 55 |
+
|
| 56 |
+
We use `black` to reformat the code by running the following command:
|
| 57 |
+
|
| 58 |
+
```bash
|
| 59 |
+
make format
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
### 🧪 Testing
|
| 63 |
+
|
| 64 |
+
We use `pytest` to test our code. You can run the tests by running the following command:
|
| 65 |
+
|
| 66 |
+
```bash
|
| 67 |
+
poetry run pytest
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
Make sure that all tests pass before submitting a pull request.
|
| 71 |
+
|
| 72 |
+
## 🚀 Release Process
|
| 73 |
+
|
| 74 |
+
At the moment, the release process is manual. We try to make frequent releases. Usually, we release a new version when we have a new feature or bugfix. A developer with admin rights to the repository will create a new release on GitHub, and then publish the new version to PyPI.
|
LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or
|
| 95 |
+
Derivative Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
| 175 |
+
|
| 176 |
+
END OF TERMS AND CONDITIONS
|
| 177 |
+
|
| 178 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 179 |
+
|
| 180 |
+
To apply the Apache License to your work, attach the following
|
| 181 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 182 |
+
replaced with your own identifying information. (Don't include
|
| 183 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 184 |
+
comment syntax for the file format. We also recommend that a
|
| 185 |
+
file or class name and description of purpose be included on the
|
| 186 |
+
same "printed page" as the copyright notice for easier
|
| 187 |
+
identification within third-party archives.
|
| 188 |
+
|
| 189 |
+
Copyright [2023] [Taranjeet Singh]
|
| 190 |
+
|
| 191 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 192 |
+
you may not use this file except in compliance with the License.
|
| 193 |
+
You may obtain a copy of the License at
|
| 194 |
+
|
| 195 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 196 |
+
|
| 197 |
+
Unless required by applicable law or agreed to in writing, software
|
| 198 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 199 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 200 |
+
See the License for the specific language governing permissions and
|
| 201 |
+
limitations under the License.
|
Makefile
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Variables
|
| 2 |
+
PYTHON := python3
|
| 3 |
+
PIP := $(PYTHON) -m pip
|
| 4 |
+
PROJECT_NAME := embedchain
|
| 5 |
+
|
| 6 |
+
# Targets
|
| 7 |
+
.PHONY: install format lint clean test ci_lint ci_test coverage
|
| 8 |
+
|
| 9 |
+
install:
|
| 10 |
+
poetry install
|
| 11 |
+
|
| 12 |
+
install_all:
|
| 13 |
+
poetry install --all-extras
|
| 14 |
+
poetry run pip install pinecone-text pinecone-client
|
| 15 |
+
|
| 16 |
+
install_es:
|
| 17 |
+
poetry install --extras elasticsearch
|
| 18 |
+
|
| 19 |
+
install_opensearch:
|
| 20 |
+
poetry install --extras opensearch
|
| 21 |
+
|
| 22 |
+
install_milvus:
|
| 23 |
+
poetry install --extras milvus
|
| 24 |
+
|
| 25 |
+
shell:
|
| 26 |
+
poetry shell
|
| 27 |
+
|
| 28 |
+
py_shell:
|
| 29 |
+
poetry run python
|
| 30 |
+
|
| 31 |
+
format:
|
| 32 |
+
$(PYTHON) -m black .
|
| 33 |
+
$(PYTHON) -m isort .
|
| 34 |
+
|
| 35 |
+
clean:
|
| 36 |
+
rm -rf dist build *.egg-info
|
| 37 |
+
|
| 38 |
+
lint:
|
| 39 |
+
poetry run ruff .
|
| 40 |
+
|
| 41 |
+
build:
|
| 42 |
+
poetry build
|
| 43 |
+
|
| 44 |
+
publish:
|
| 45 |
+
poetry publish
|
| 46 |
+
|
| 47 |
+
# for example: make test file=tests/test_factory.py
|
| 48 |
+
test:
|
| 49 |
+
poetry run pytest $(file)
|
| 50 |
+
|
| 51 |
+
coverage:
|
| 52 |
+
poetry run pytest --cov=$(PROJECT_NAME) --cov-report=xml
|
README.md
CHANGED
|
@@ -1,12 +1,135 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
|
| 4 |
-
colorFrom: blue
|
| 5 |
-
colorTo: yellow
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version: 4.
|
| 8 |
-
app_file: app.py
|
| 9 |
-
pinned: false
|
| 10 |
---
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: embedchain
|
| 3 |
+
app_file: D:\New folder\embedchain\my-rag-app\app.py
|
|
|
|
|
|
|
| 4 |
sdk: gradio
|
| 5 |
+
sdk_version: 4.11.0
|
|
|
|
|
|
|
| 6 |
---
|
| 7 |
+
<p align="center">
|
| 8 |
+
<img src="docs/logo/dark.svg" width="400px" alt="Embedchain Logo">
|
| 9 |
+
</p>
|
| 10 |
|
| 11 |
+
<p align="center">
|
| 12 |
+
<a href="https://runacap.com/ross-index/q3-2023/" target="_blank" rel="noopener"><img style="width: 260px; height: 56px" src="https://runacap.com/wp-content/uploads/2023/10/ROSS_badge_black_Q3_2023.svg" alt="ROSS Index - Fastest Growing Open-Source Startups in Q3 2023 | Runa Capital" width="260" height="56"/></a>
|
| 13 |
+
</p>
|
| 14 |
+
|
| 15 |
+
<p align="center">
|
| 16 |
+
<a href="https://pypi.org/project/embedchain/">
|
| 17 |
+
<img src="https://img.shields.io/pypi/v/embedchain" alt="PyPI">
|
| 18 |
+
</a>
|
| 19 |
+
<a href="https://pepy.tech/project/embedchain">
|
| 20 |
+
<img src="https://static.pepy.tech/badge/embedchain" alt="Downloads">
|
| 21 |
+
</a>
|
| 22 |
+
<a href="https://embedchain.ai/slack">
|
| 23 |
+
<img src="https://img.shields.io/badge/slack-embedchain-brightgreen.svg?logo=slack" alt="Slack">
|
| 24 |
+
</a>
|
| 25 |
+
<a href="https://embedchain.ai/discord">
|
| 26 |
+
<img src="https://dcbadge.vercel.app/api/server/6PzXDgEjG5?style=flat" alt="Discord">
|
| 27 |
+
</a>
|
| 28 |
+
<a href="https://twitter.com/embedchain">
|
| 29 |
+
<img src="https://img.shields.io/twitter/follow/embedchain" alt="Twitter">
|
| 30 |
+
</a>
|
| 31 |
+
<a href="https://colab.research.google.com/drive/138lMWhENGeEu7Q1-6lNbNTHGLZXBBz_B?usp=sharing">
|
| 32 |
+
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab">
|
| 33 |
+
</a>
|
| 34 |
+
<a href="https://codecov.io/gh/embedchain/embedchain">
|
| 35 |
+
<img src="https://codecov.io/gh/embedchain/embedchain/graph/badge.svg?token=EMRRHZXW1Q" alt="codecov">
|
| 36 |
+
</a>
|
| 37 |
+
</p>
|
| 38 |
+
|
| 39 |
+
<hr />
|
| 40 |
+
|
| 41 |
+
## What is Embedchain?
|
| 42 |
+
|
| 43 |
+
Embedchain is an Open Source RAG Framework that makes it easy to create and deploy AI apps. At its core, Embedchain follows the design principle of being *"Conventional but Configurable"* to serve both software engineers and machine learning engineers.
|
| 44 |
+
|
| 45 |
+
Embedchain streamlines the creation of Retrieval-Augmented Generation (RAG) applications, offering a seamless process for managing various types of unstructured data. It efficiently segments data into manageable chunks, generates relevant embeddings, and stores them in a vector database for optimized retrieval. With a suite of diverse APIs, it enables users to extract contextual information, find precise answers, or engage in interactive chat conversations, all tailored to their own data.
|
| 46 |
+
|
| 47 |
+
## 🔧 Quick install
|
| 48 |
+
|
| 49 |
+
### Python API
|
| 50 |
+
|
| 51 |
+
```bash
|
| 52 |
+
pip install embedchain
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
## ✨ Live demo
|
| 56 |
+
|
| 57 |
+
Checkout the [Chat with PDF](https://embedchain.ai/demo/chat-pdf) live demo we created using Embedchain. You can find the source code [here](https://github.com/embedchain/embedchain/tree/main/examples/chat-pdf).
|
| 58 |
+
|
| 59 |
+
## 🔍 Usage
|
| 60 |
+
|
| 61 |
+
<!-- Demo GIF or Image -->
|
| 62 |
+
<p align="center">
|
| 63 |
+
<img src="docs/images/cover.gif" width="900px" alt="Embedchain Demo">
|
| 64 |
+
</p>
|
| 65 |
+
|
| 66 |
+
For example, you can create an Elon Musk bot using the following code:
|
| 67 |
+
|
| 68 |
+
```python
|
| 69 |
+
import os
|
| 70 |
+
from embedchain import App
|
| 71 |
+
|
| 72 |
+
# Create a bot instance
|
| 73 |
+
os.environ["OPENAI_API_KEY"] = "YOUR API KEY"
|
| 74 |
+
elon_bot = App()
|
| 75 |
+
|
| 76 |
+
# Embed online resources
|
| 77 |
+
elon_bot.add("https://en.wikipedia.org/wiki/Elon_Musk")
|
| 78 |
+
elon_bot.add("https://www.forbes.com/profile/elon-musk")
|
| 79 |
+
|
| 80 |
+
# Query the bot
|
| 81 |
+
elon_bot.query("How many companies does Elon Musk run and name those?")
|
| 82 |
+
# Answer: Elon Musk currently runs several companies. As of my knowledge, he is the CEO and lead designer of SpaceX, the CEO and product architect of Tesla, Inc., the CEO and founder of Neuralink, and the CEO and founder of The Boring Company. However, please note that this information may change over time, so it's always good to verify the latest updates.
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
You can also try it in your browser with Google Colab:
|
| 86 |
+
|
| 87 |
+
[](https://colab.research.google.com/drive/17ON1LPonnXAtLaZEebnOktstB_1cJJmh?usp=sharing)
|
| 88 |
+
|
| 89 |
+
## 📖 Documentation
|
| 90 |
+
Comprehensive guides and API documentation are available to help you get the most out of Embedchain:
|
| 91 |
+
|
| 92 |
+
- [Introduction](https://docs.embedchain.ai/get-started/introduction#what-is-embedchain)
|
| 93 |
+
- [Getting Started](https://docs.embedchain.ai/get-started/quickstart)
|
| 94 |
+
- [Examples](https://docs.embedchain.ai/examples)
|
| 95 |
+
- [Supported data types](https://docs.embedchain.ai/components/data-sources/overview)
|
| 96 |
+
|
| 97 |
+
## 🔗 Join the Community
|
| 98 |
+
|
| 99 |
+
* Connect with fellow developers by joining our [Slack Community](https://embedchain.ai/slack) or [Discord Community](https://embedchain.ai/discord).
|
| 100 |
+
|
| 101 |
+
* Dive into [GitHub Discussions](https://github.com/embedchain/embedchain/discussions), ask questions, or share your experiences.
|
| 102 |
+
|
| 103 |
+
## 🤝 Schedule a 1-on-1 Session
|
| 104 |
+
|
| 105 |
+
Book a [1-on-1 Session](https://cal.com/taranjeetio/ec) with the founders, to discuss any issues, provide feedback, or explore how we can improve Embedchain for you.
|
| 106 |
+
|
| 107 |
+
## 🌐 Contributing
|
| 108 |
+
|
| 109 |
+
Contributions are welcome! Please check out the issues on the repository, and feel free to open a pull request.
|
| 110 |
+
For more information, please see the [contributing guidelines](CONTRIBUTING.md).
|
| 111 |
+
|
| 112 |
+
For more reference, please go through [Development Guide](https://docs.embedchain.ai/contribution/dev) and [Documentation Guide](https://docs.embedchain.ai/contribution/docs).
|
| 113 |
+
|
| 114 |
+
<a href="https://github.com/embedchain/embedchain/graphs/contributors">
|
| 115 |
+
<img src="https://contrib.rocks/image?repo=embedchain/embedchain" />
|
| 116 |
+
</a>
|
| 117 |
+
|
| 118 |
+
## Anonymous Telemetry
|
| 119 |
+
|
| 120 |
+
We collect anonymous usage metrics to enhance our package's quality and user experience. This includes data like feature usage frequency and system info, but never personal details. The data helps us prioritize improvements and ensure compatibility. If you wish to opt-out, set the environment variable `EC_TELEMETRY=false`. We prioritize data security and don't share this data externally.
|
| 121 |
+
|
| 122 |
+
## Citation
|
| 123 |
+
|
| 124 |
+
If you utilize this repository, please consider citing it with:
|
| 125 |
+
|
| 126 |
+
```
|
| 127 |
+
@misc{embedchain,
|
| 128 |
+
author = {Taranjeet Singh, Deshraj Yadav},
|
| 129 |
+
title = {Embedchain: The Open Source RAG Framework},
|
| 130 |
+
year = {2023},
|
| 131 |
+
publisher = {GitHub},
|
| 132 |
+
journal = {GitHub repository},
|
| 133 |
+
howpublished = {\url{https://github.com/embedchain/embedchain}},
|
| 134 |
+
}
|
| 135 |
+
```
|
chainlit.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Welcome to Chainlit! 🚀🤖
|
| 2 |
+
|
| 3 |
+
Hi there, Developer! 👋 We're excited to have you on board. Chainlit is a powerful tool designed to help you prototype, debug and share applications built on top of LLMs.
|
| 4 |
+
|
| 5 |
+
## Useful Links 🔗
|
| 6 |
+
|
| 7 |
+
- **Documentation:** Get started with our comprehensive [Chainlit Documentation](https://docs.chainlit.io) 📚
|
| 8 |
+
- **Discord Community:** Join our friendly [Chainlit Discord](https://discord.gg/k73SQ3FyUh) to ask questions, share your projects, and connect with other developers! 💬
|
| 9 |
+
|
| 10 |
+
We can't wait to see what you create with Chainlit! Happy coding! 💻😊
|
| 11 |
+
|
| 12 |
+
## Welcome screen
|
| 13 |
+
|
| 14 |
+
To modify the welcome screen, edit the `chainlit.md` file at the root of your project. If you do not want a welcome screen, just leave this file empty.
|
config.yaml
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
app:
|
| 2 |
+
config:
|
| 3 |
+
name: 'mistral-streamlit-app'
|
| 4 |
+
|
| 5 |
+
llm:
|
| 6 |
+
provider: huggingface
|
| 7 |
+
config:
|
| 8 |
+
model: 'mistralai/Mixtral-8x7B-Instruct-v0.1'
|
| 9 |
+
temperature: 0.1
|
| 10 |
+
max_tokens: 250
|
| 11 |
+
top_p: 0.1
|
| 12 |
+
stream: true
|
| 13 |
+
|
| 14 |
+
embedder:
|
| 15 |
+
provider: huggingface
|
| 16 |
+
config:
|
| 17 |
+
model: 'sentence-transformers/all-mpnet-base-v2'
|
configs/anthropic.yaml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
llm:
|
| 2 |
+
provider: anthropic
|
| 3 |
+
config:
|
| 4 |
+
model: 'claude-instant-1'
|
| 5 |
+
temperature: 0.5
|
| 6 |
+
max_tokens: 1000
|
| 7 |
+
top_p: 1
|
| 8 |
+
stream: false
|
configs/azure_openai.yaml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
app:
|
| 2 |
+
config:
|
| 3 |
+
id: azure-openai-app
|
| 4 |
+
|
| 5 |
+
llm:
|
| 6 |
+
provider: azure_openai
|
| 7 |
+
config:
|
| 8 |
+
model: gpt-35-turbo
|
| 9 |
+
deployment_name: your_llm_deployment_name
|
| 10 |
+
temperature: 0.5
|
| 11 |
+
max_tokens: 1000
|
| 12 |
+
top_p: 1
|
| 13 |
+
stream: false
|
| 14 |
+
|
| 15 |
+
embedder:
|
| 16 |
+
provider: azure_openai
|
| 17 |
+
config:
|
| 18 |
+
model: text-embedding-ada-002
|
| 19 |
+
deployment_name: you_embedding_model_deployment_name
|
configs/chroma.yaml
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
app:
|
| 2 |
+
config:
|
| 3 |
+
id: 'my-app'
|
| 4 |
+
|
| 5 |
+
llm:
|
| 6 |
+
provider: openai
|
| 7 |
+
config:
|
| 8 |
+
model: 'gpt-3.5-turbo'
|
| 9 |
+
temperature: 0.5
|
| 10 |
+
max_tokens: 1000
|
| 11 |
+
top_p: 1
|
| 12 |
+
stream: false
|
| 13 |
+
|
| 14 |
+
vectordb:
|
| 15 |
+
provider: chroma
|
| 16 |
+
config:
|
| 17 |
+
collection_name: 'my-app'
|
| 18 |
+
dir: db
|
| 19 |
+
allow_reset: true
|
| 20 |
+
|
| 21 |
+
embedder:
|
| 22 |
+
provider: openai
|
| 23 |
+
config:
|
| 24 |
+
model: 'text-embedding-ada-002'
|
configs/chunker.yaml
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
chunker:
|
| 2 |
+
chunk_size: 100
|
| 3 |
+
chunk_overlap: 20
|
| 4 |
+
length_function: 'len'
|
configs/cohere.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
llm:
|
| 2 |
+
provider: cohere
|
| 3 |
+
config:
|
| 4 |
+
model: large
|
| 5 |
+
temperature: 0.5
|
| 6 |
+
max_tokens: 1000
|
| 7 |
+
top_p: 1
|
configs/full-stack.yaml
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
app:
|
| 2 |
+
config:
|
| 3 |
+
id: 'full-stack-app'
|
| 4 |
+
|
| 5 |
+
chunker:
|
| 6 |
+
chunk_size: 100
|
| 7 |
+
chunk_overlap: 20
|
| 8 |
+
length_function: 'len'
|
| 9 |
+
|
| 10 |
+
llm:
|
| 11 |
+
provider: openai
|
| 12 |
+
config:
|
| 13 |
+
model: 'gpt-3.5-turbo'
|
| 14 |
+
temperature: 0.5
|
| 15 |
+
max_tokens: 1000
|
| 16 |
+
top_p: 1
|
| 17 |
+
stream: false
|
| 18 |
+
prompt: |
|
| 19 |
+
Use the following pieces of context to answer the query at the end.
|
| 20 |
+
If you don't know the answer, just say that you don't know, don't try to make up an answer.
|
| 21 |
+
|
| 22 |
+
$context
|
| 23 |
+
|
| 24 |
+
Query: $query
|
| 25 |
+
|
| 26 |
+
Helpful Answer:
|
| 27 |
+
system_prompt: |
|
| 28 |
+
Act as William Shakespeare. Answer the following questions in the style of William Shakespeare.
|
| 29 |
+
|
| 30 |
+
vectordb:
|
| 31 |
+
provider: chroma
|
| 32 |
+
config:
|
| 33 |
+
collection_name: 'my-collection-name'
|
| 34 |
+
dir: db
|
| 35 |
+
allow_reset: true
|
| 36 |
+
|
| 37 |
+
embedder:
|
| 38 |
+
provider: openai
|
| 39 |
+
config:
|
| 40 |
+
model: 'text-embedding-ada-002'
|
configs/google.yaml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
llm:
|
| 2 |
+
provider: google
|
| 3 |
+
config:
|
| 4 |
+
model: gemini-pro
|
| 5 |
+
max_tokens: 1000
|
| 6 |
+
temperature: 0.9
|
| 7 |
+
top_p: 1.0
|
| 8 |
+
stream: false
|
| 9 |
+
|
| 10 |
+
embedder:
|
| 11 |
+
provider: google
|
| 12 |
+
config:
|
| 13 |
+
model: models/embedding-001
|
configs/gpt4.yaml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
llm:
|
| 2 |
+
provider: openai
|
| 3 |
+
config:
|
| 4 |
+
model: 'gpt-4'
|
| 5 |
+
temperature: 0.5
|
| 6 |
+
max_tokens: 1000
|
| 7 |
+
top_p: 1
|
| 8 |
+
stream: false
|
configs/gpt4all.yaml
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
llm:
|
| 2 |
+
provider: gpt4all
|
| 3 |
+
config:
|
| 4 |
+
model: 'orca-mini-3b-gguf2-q4_0.gguf'
|
| 5 |
+
temperature: 0.5
|
| 6 |
+
max_tokens: 1000
|
| 7 |
+
top_p: 1
|
| 8 |
+
stream: false
|
| 9 |
+
|
| 10 |
+
embedder:
|
| 11 |
+
provider: gpt4all
|
configs/huggingface.yaml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
llm:
|
| 2 |
+
provider: huggingface
|
| 3 |
+
config:
|
| 4 |
+
model: 'google/flan-t5-xxl'
|
| 5 |
+
temperature: 0.5
|
| 6 |
+
max_tokens: 1000
|
| 7 |
+
top_p: 0.5
|
| 8 |
+
stream: false
|
configs/jina.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
llm:
|
| 2 |
+
provider: jina
|
| 3 |
+
config:
|
| 4 |
+
temperature: 0.5
|
| 5 |
+
max_tokens: 1000
|
| 6 |
+
top_p: 1
|
| 7 |
+
stream: false
|
configs/llama2.yaml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
llm:
|
| 2 |
+
provider: llama2
|
| 3 |
+
config:
|
| 4 |
+
model: 'a16z-infra/llama13b-v2-chat:df7690f1994d94e96ad9d568eac121aecf50684a0b0963b25a41cc40061269e5'
|
| 5 |
+
temperature: 0.5
|
| 6 |
+
max_tokens: 1000
|
| 7 |
+
top_p: 0.5
|
| 8 |
+
stream: false
|
configs/ollama.yaml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
llm:
|
| 2 |
+
provider: ollama
|
| 3 |
+
config:
|
| 4 |
+
model: 'llama2'
|
| 5 |
+
temperature: 0.5
|
| 6 |
+
top_p: 1
|
| 7 |
+
stream: true
|
| 8 |
+
|
| 9 |
+
embedder:
|
| 10 |
+
provider: huggingface
|
| 11 |
+
config:
|
| 12 |
+
model: 'BAAI/bge-small-en-v1.5'
|
configs/opensearch.yaml
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
app:
|
| 2 |
+
config:
|
| 3 |
+
id: 'my-app'
|
| 4 |
+
log_level: 'WARNING'
|
| 5 |
+
collect_metrics: true
|
| 6 |
+
collection_name: 'my-app'
|
| 7 |
+
|
| 8 |
+
llm:
|
| 9 |
+
provider: openai
|
| 10 |
+
config:
|
| 11 |
+
model: 'gpt-3.5-turbo'
|
| 12 |
+
temperature: 0.5
|
| 13 |
+
max_tokens: 1000
|
| 14 |
+
top_p: 1
|
| 15 |
+
stream: false
|
| 16 |
+
|
| 17 |
+
vectordb:
|
| 18 |
+
provider: opensearch
|
| 19 |
+
config:
|
| 20 |
+
opensearch_url: 'https://localhost:9200'
|
| 21 |
+
http_auth:
|
| 22 |
+
- admin
|
| 23 |
+
- admin
|
| 24 |
+
vector_dimension: 1536
|
| 25 |
+
collection_name: 'my-app'
|
| 26 |
+
use_ssl: false
|
| 27 |
+
verify_certs: false
|
| 28 |
+
|
| 29 |
+
embedder:
|
| 30 |
+
provider: openai
|
| 31 |
+
config:
|
| 32 |
+
model: 'text-embedding-ada-002'
|
| 33 |
+
deployment_name: 'my-app'
|
configs/opensource.yaml
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
app:
|
| 2 |
+
config:
|
| 3 |
+
id: 'open-source-app'
|
| 4 |
+
collect_metrics: false
|
| 5 |
+
|
| 6 |
+
llm:
|
| 7 |
+
provider: gpt4all
|
| 8 |
+
config:
|
| 9 |
+
model: 'orca-mini-3b-gguf2-q4_0.gguf'
|
| 10 |
+
temperature: 0.5
|
| 11 |
+
max_tokens: 1000
|
| 12 |
+
top_p: 1
|
| 13 |
+
stream: false
|
| 14 |
+
|
| 15 |
+
vectordb:
|
| 16 |
+
provider: chroma
|
| 17 |
+
config:
|
| 18 |
+
collection_name: 'open-source-app'
|
| 19 |
+
dir: db
|
| 20 |
+
allow_reset: true
|
| 21 |
+
|
| 22 |
+
embedder:
|
| 23 |
+
provider: gpt4all
|
| 24 |
+
config:
|
| 25 |
+
deployment_name: 'test-deployment'
|
configs/pinecone.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
vectordb:
|
| 2 |
+
provider: pinecone
|
| 3 |
+
config:
|
| 4 |
+
metric: cosine
|
| 5 |
+
vector_dimension: 1536
|
| 6 |
+
collection_name: my-pinecone-index
|
configs/pipeline.yaml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
pipeline:
|
| 2 |
+
config:
|
| 3 |
+
name: Example pipeline
|
| 4 |
+
id: pipeline-1 # Make sure that id is different every time you create a new pipeline
|
| 5 |
+
|
| 6 |
+
vectordb:
|
| 7 |
+
provider: chroma
|
| 8 |
+
config:
|
| 9 |
+
collection_name: pipeline-1
|
| 10 |
+
dir: db
|
| 11 |
+
allow_reset: true
|
| 12 |
+
|
| 13 |
+
llm:
|
| 14 |
+
provider: gpt4all
|
| 15 |
+
config:
|
| 16 |
+
model: 'orca-mini-3b-gguf2-q4_0.gguf'
|
| 17 |
+
temperature: 0.5
|
| 18 |
+
max_tokens: 1000
|
| 19 |
+
top_p: 1
|
| 20 |
+
stream: false
|
| 21 |
+
|
| 22 |
+
embedding_model:
|
| 23 |
+
provider: gpt4all
|
| 24 |
+
config:
|
| 25 |
+
model: 'all-MiniLM-L6-v2'
|
| 26 |
+
deployment_name: null
|
configs/together.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
llm:
|
| 2 |
+
provider: together
|
| 3 |
+
config:
|
| 4 |
+
model: mistralai/Mixtral-8x7B-Instruct-v0.1
|
| 5 |
+
temperature: 0.5
|
| 6 |
+
max_tokens: 1000
|
configs/vertexai.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
llm:
|
| 2 |
+
provider: vertexai
|
| 3 |
+
config:
|
| 4 |
+
model: 'chat-bison'
|
| 5 |
+
temperature: 0.5
|
| 6 |
+
top_p: 0.5
|
configs/vllm.yaml
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
llm:
|
| 2 |
+
provider: vllm
|
| 3 |
+
config:
|
| 4 |
+
model: 'meta-llama/Llama-2-70b-hf'
|
| 5 |
+
temperature: 0.5
|
| 6 |
+
top_p: 1
|
| 7 |
+
top_k: 10
|
| 8 |
+
stream: true
|
| 9 |
+
trust_remote_code: true
|
| 10 |
+
|
| 11 |
+
embedder:
|
| 12 |
+
provider: huggingface
|
| 13 |
+
config:
|
| 14 |
+
model: 'BAAI/bge-small-en-v1.5'
|
configs/weaviate.yaml
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
vectordb:
|
| 2 |
+
provider: weaviate
|
| 3 |
+
config:
|
| 4 |
+
collection_name: my_weaviate_index
|
docs/Makefile
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
install:
|
| 2 |
+
npm i -g mintlify
|
| 3 |
+
|
| 4 |
+
run_local:
|
| 5 |
+
mintlify dev
|
| 6 |
+
|
| 7 |
+
troubleshoot:
|
| 8 |
+
mintlify install
|
| 9 |
+
|
| 10 |
+
.PHONY: install run_local troubleshoot
|
docs/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Contributing to embedchain docs
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
### 👩💻 Development
|
| 5 |
+
|
| 6 |
+
Install the [Mintlify CLI](https://www.npmjs.com/package/mintlify) to preview the documentation changes locally. To install, use the following command
|
| 7 |
+
|
| 8 |
+
```
|
| 9 |
+
npm i -g mintlify
|
| 10 |
+
```
|
| 11 |
+
|
| 12 |
+
Run the following command at the root of your documentation (where mint.json is)
|
| 13 |
+
|
| 14 |
+
```
|
| 15 |
+
mintlify dev
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
### 😎 Publishing Changes
|
| 19 |
+
|
| 20 |
+
Changes will be deployed to production automatically after your PR is merged to the main branch.
|
| 21 |
+
|
| 22 |
+
#### Troubleshooting
|
| 23 |
+
|
| 24 |
+
- Mintlify dev isn't running - Run `mintlify install` it'll re-install dependencies.
|
| 25 |
+
- Page loads as a 404 - Make sure you are running in a folder with `mint.json`
|
docs/_snippets/get-help.mdx
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<CardGroup cols={3}>
|
| 2 |
+
<Card title="Talk to founders" icon="calendar" href="https://cal.com/taranjeetio/ec">
|
| 3 |
+
Schedule a call
|
| 4 |
+
</Card>
|
| 5 |
+
<Card title="Slack" icon="slack" href="https://embedchain.ai/slack" color="#4A154B">
|
| 6 |
+
Join our slack community
|
| 7 |
+
</Card>
|
| 8 |
+
<Card title="Discord" icon="discord" href="https://discord.gg/6PzXDgEjG5" color="#7289DA">
|
| 9 |
+
Join our discord community
|
| 10 |
+
</Card>
|
| 11 |
+
</CardGroup>
|
docs/_snippets/missing-data-source-tip.mdx
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<p>If you can't find the specific data source, please feel free to request through one of the following channels and help us prioritize.</p>
|
| 2 |
+
|
| 3 |
+
<CardGroup cols={2}>
|
| 4 |
+
<Card title="Google Form" icon="file" href="https://forms.gle/NDRCKsRpUHsz2Wcm8" color="#7387d0">
|
| 5 |
+
Fill out this form
|
| 6 |
+
</Card>
|
| 7 |
+
<Card title="Slack" icon="slack" href="https://embedchain.ai/slack" color="#4A154B">
|
| 8 |
+
Let us know on our slack community
|
| 9 |
+
</Card>
|
| 10 |
+
<Card title="Discord" icon="discord" href="https://discord.gg/6PzXDgEjG5" color="#7289DA">
|
| 11 |
+
Let us know on discord community
|
| 12 |
+
</Card>
|
| 13 |
+
<Card title="GitHub" icon="github" href="https://github.com/embedchain/embedchain/issues/new?assignees=&labels=&projects=&template=feature_request.yml" color="#181717">
|
| 14 |
+
Open an issue on our GitHub
|
| 15 |
+
</Card>
|
| 16 |
+
<Card title="Schedule a call" icon="calendar" href="https://cal.com/taranjeetio/ec">
|
| 17 |
+
Schedule a call with Embedchain founder
|
| 18 |
+
</Card>
|
| 19 |
+
</CardGroup>
|
docs/_snippets/missing-llm-tip.mdx
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<p>If you can't find the specific LLM you need, no need to fret. We're continuously expanding our support for additional LLMs, and you can help us prioritize by opening an issue on our GitHub or simply reaching out to us on our Slack or Discord community.</p>
|
| 2 |
+
|
| 3 |
+
<CardGroup cols={2}>
|
| 4 |
+
<Card title="Slack" icon="slack" href="https://embedchain.ai/slack" color="#4A154B">
|
| 5 |
+
Let us know on our slack community
|
| 6 |
+
</Card>
|
| 7 |
+
<Card title="Discord" icon="discord" href="https://discord.gg/6PzXDgEjG5" color="#7289DA">
|
| 8 |
+
Let us know on discord community
|
| 9 |
+
</Card>
|
| 10 |
+
<Card title="GitHub" icon="github" href="https://github.com/embedchain/embedchain/issues/new?assignees=&labels=&projects=&template=feature_request.yml" color="#181717">
|
| 11 |
+
Open an issue on our GitHub
|
| 12 |
+
</Card>
|
| 13 |
+
<Card title="Schedule a call" icon="calendar" href="https://cal.com/taranjeetio/ec">
|
| 14 |
+
Schedule a call with Embedchain founder
|
| 15 |
+
</Card>
|
| 16 |
+
</CardGroup>
|
docs/_snippets/missing-vector-db-tip.mdx
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
+
<p>If you can't find specific feature or run into issues, please feel free to reach out through one of the following channels.</p>
|
| 4 |
+
|
| 5 |
+
<CardGroup cols={2}>
|
| 6 |
+
<Card title="Slack" icon="slack" href="https://embedchain.ai/slack" color="#4A154B">
|
| 7 |
+
Let us know on our slack community
|
| 8 |
+
</Card>
|
| 9 |
+
<Card title="Discord" icon="discord" href="https://discord.gg/6PzXDgEjG5" color="#7289DA">
|
| 10 |
+
Let us know on discord community
|
| 11 |
+
</Card>
|
| 12 |
+
<Card title="GitHub" icon="github" href="https://github.com/embedchain/embedchain/issues/new?assignees=&labels=&projects=&template=feature_request.yml" color="#181717">
|
| 13 |
+
Open an issue on our GitHub
|
| 14 |
+
</Card>
|
| 15 |
+
<Card title="Schedule a call" icon="calendar" href="https://cal.com/taranjeetio/ec">
|
| 16 |
+
Schedule a call with Embedchain founder
|
| 17 |
+
</Card>
|
| 18 |
+
</CardGroup>
|
docs/api-reference/advanced/configuration.mdx
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: 'Custom configurations'
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
Embedchain offers several configuration options for your LLM, vector database, and embedding model. All of these configuration options are optional and have sane defaults.
|
| 6 |
+
|
| 7 |
+
You can configure different components of your app (`llm`, `embedding model`, or `vector database`) through a simple yaml configuration that Embedchain offers. Here is a generic full-stack example of the yaml config:
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
<Tip>
|
| 11 |
+
Embedchain applications are configurable using YAML file, JSON file or by directly passing the config dictionary. Checkout the [docs here](/api-reference/app/overview#usage) on how to use other formats.
|
| 12 |
+
</Tip>
|
| 13 |
+
|
| 14 |
+
<CodeGroup>
|
| 15 |
+
```yaml config.yaml
|
| 16 |
+
app:
|
| 17 |
+
config:
|
| 18 |
+
name: 'full-stack-app'
|
| 19 |
+
|
| 20 |
+
llm:
|
| 21 |
+
provider: openai
|
| 22 |
+
config:
|
| 23 |
+
model: 'gpt-3.5-turbo'
|
| 24 |
+
temperature: 0.5
|
| 25 |
+
max_tokens: 1000
|
| 26 |
+
top_p: 1
|
| 27 |
+
stream: false
|
| 28 |
+
api_key: sk-xxx
|
| 29 |
+
prompt: |
|
| 30 |
+
Use the following pieces of context to answer the query at the end.
|
| 31 |
+
If you don't know the answer, just say that you don't know, don't try to make up an answer.
|
| 32 |
+
|
| 33 |
+
$context
|
| 34 |
+
|
| 35 |
+
Query: $query
|
| 36 |
+
|
| 37 |
+
Helpful Answer:
|
| 38 |
+
system_prompt: |
|
| 39 |
+
Act as William Shakespeare. Answer the following questions in the style of William Shakespeare.
|
| 40 |
+
|
| 41 |
+
vectordb:
|
| 42 |
+
provider: chroma
|
| 43 |
+
config:
|
| 44 |
+
collection_name: 'full-stack-app'
|
| 45 |
+
dir: db
|
| 46 |
+
allow_reset: true
|
| 47 |
+
|
| 48 |
+
embedder:
|
| 49 |
+
provider: openai
|
| 50 |
+
config:
|
| 51 |
+
model: 'text-embedding-ada-002'
|
| 52 |
+
api_key: sk-xxx
|
| 53 |
+
|
| 54 |
+
chunker:
|
| 55 |
+
chunk_size: 2000
|
| 56 |
+
chunk_overlap: 100
|
| 57 |
+
length_function: 'len'
|
| 58 |
+
min_chunk_size: 0
|
| 59 |
+
|
| 60 |
+
cache:
|
| 61 |
+
similarity_evaluation:
|
| 62 |
+
strategy: distance
|
| 63 |
+
max_distance: 1.0
|
| 64 |
+
config:
|
| 65 |
+
similarity_threshold: 0.8
|
| 66 |
+
auto_flush: 50
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
```json config.json
|
| 70 |
+
{
|
| 71 |
+
"app": {
|
| 72 |
+
"config": {
|
| 73 |
+
"name": "full-stack-app"
|
| 74 |
+
}
|
| 75 |
+
},
|
| 76 |
+
"llm": {
|
| 77 |
+
"provider": "openai",
|
| 78 |
+
"config": {
|
| 79 |
+
"model": "gpt-3.5-turbo",
|
| 80 |
+
"temperature": 0.5,
|
| 81 |
+
"max_tokens": 1000,
|
| 82 |
+
"top_p": 1,
|
| 83 |
+
"stream": false,
|
| 84 |
+
"prompt": "Use the following pieces of context to answer the query at the end.\nIf you don't know the answer, just say that you don't know, don't try to make up an answer.\n$context\n\nQuery: $query\n\nHelpful Answer:",
|
| 85 |
+
"system_prompt": "Act as William Shakespeare. Answer the following questions in the style of William Shakespeare.",
|
| 86 |
+
"api_key": "sk-xxx"
|
| 87 |
+
}
|
| 88 |
+
},
|
| 89 |
+
"vectordb": {
|
| 90 |
+
"provider": "chroma",
|
| 91 |
+
"config": {
|
| 92 |
+
"collection_name": "full-stack-app",
|
| 93 |
+
"dir": "db",
|
| 94 |
+
"allow_reset": true
|
| 95 |
+
}
|
| 96 |
+
},
|
| 97 |
+
"embedder": {
|
| 98 |
+
"provider": "openai",
|
| 99 |
+
"config": {
|
| 100 |
+
"model": "text-embedding-ada-002",
|
| 101 |
+
"api_key": "sk-xxx"
|
| 102 |
+
}
|
| 103 |
+
},
|
| 104 |
+
"chunker": {
|
| 105 |
+
"chunk_size": 2000,
|
| 106 |
+
"chunk_overlap": 100,
|
| 107 |
+
"length_function": "len",
|
| 108 |
+
"min_chunk_size": 0
|
| 109 |
+
},
|
| 110 |
+
"cache": {
|
| 111 |
+
"similarity_evaluation": {
|
| 112 |
+
"strategy": "distance",
|
| 113 |
+
"max_distance": 1.0,
|
| 114 |
+
},
|
| 115 |
+
"config": {
|
| 116 |
+
"similarity_threshold": 0.8,
|
| 117 |
+
"auto_flush": 50,
|
| 118 |
+
},
|
| 119 |
+
},
|
| 120 |
+
}
|
| 121 |
+
```
|
| 122 |
+
|
| 123 |
+
```python config.py
|
| 124 |
+
config = {
|
| 125 |
+
'app': {
|
| 126 |
+
'config': {
|
| 127 |
+
'name': 'full-stack-app'
|
| 128 |
+
}
|
| 129 |
+
},
|
| 130 |
+
'llm': {
|
| 131 |
+
'provider': 'openai',
|
| 132 |
+
'config': {
|
| 133 |
+
'model': 'gpt-3.5-turbo',
|
| 134 |
+
'temperature': 0.5,
|
| 135 |
+
'max_tokens': 1000,
|
| 136 |
+
'top_p': 1,
|
| 137 |
+
'stream': False,
|
| 138 |
+
'prompt': (
|
| 139 |
+
"Use the following pieces of context to answer the query at the end.\n"
|
| 140 |
+
"If you don't know the answer, just say that you don't know, don't try to make up an answer.\n"
|
| 141 |
+
"$context\n\nQuery: $query\n\nHelpful Answer:"
|
| 142 |
+
),
|
| 143 |
+
'system_prompt': (
|
| 144 |
+
"Act as William Shakespeare. Answer the following questions in the style of William Shakespeare."
|
| 145 |
+
),
|
| 146 |
+
'api_key': 'sk-xxx'
|
| 147 |
+
}
|
| 148 |
+
},
|
| 149 |
+
'vectordb': {
|
| 150 |
+
'provider': 'chroma',
|
| 151 |
+
'config': {
|
| 152 |
+
'collection_name': 'full-stack-app',
|
| 153 |
+
'dir': 'db',
|
| 154 |
+
'allow_reset': True
|
| 155 |
+
}
|
| 156 |
+
},
|
| 157 |
+
'embedder': {
|
| 158 |
+
'provider': 'openai',
|
| 159 |
+
'config': {
|
| 160 |
+
'model': 'text-embedding-ada-002',
|
| 161 |
+
'api_key': 'sk-xxx'
|
| 162 |
+
}
|
| 163 |
+
},
|
| 164 |
+
'chunker': {
|
| 165 |
+
'chunk_size': 2000,
|
| 166 |
+
'chunk_overlap': 100,
|
| 167 |
+
'length_function': 'len',
|
| 168 |
+
'min_chunk_size': 0
|
| 169 |
+
},
|
| 170 |
+
'cache': {
|
| 171 |
+
'similarity_evaluation': {
|
| 172 |
+
'strategy': 'distance',
|
| 173 |
+
'max_distance': 1.0,
|
| 174 |
+
},
|
| 175 |
+
'config': {
|
| 176 |
+
'similarity_threshold': 0.8,
|
| 177 |
+
'auto_flush': 50,
|
| 178 |
+
},
|
| 179 |
+
},
|
| 180 |
+
}
|
| 181 |
+
```
|
| 182 |
+
</CodeGroup>
|
| 183 |
+
|
| 184 |
+
Alright, let's dive into what each key means in the yaml config above:
|
| 185 |
+
|
| 186 |
+
1. `app` Section:
|
| 187 |
+
- `config`:
|
| 188 |
+
- `name` (String): The name of your full-stack application.
|
| 189 |
+
- `id` (String): The id of your full-stack application.
|
| 190 |
+
<Note>Only use this to reload already created apps. We recommend users to not create their own ids.</Note>
|
| 191 |
+
- `collect_metrics` (Boolean): Indicates whether metrics should be collected for the app, defaults to `True`
|
| 192 |
+
- `log_level` (String): The log level for the app, defaults to `WARNING`
|
| 193 |
+
2. `llm` Section:
|
| 194 |
+
- `provider` (String): The provider for the language model, which is set to 'openai'. You can find the full list of llm providers in [our docs](/components/llms).
|
| 195 |
+
- `config`:
|
| 196 |
+
- `model` (String): The specific model being used, 'gpt-3.5-turbo'.
|
| 197 |
+
- `temperature` (Float): Controls the randomness of the model's output. A higher value (closer to 1) makes the output more random.
|
| 198 |
+
- `max_tokens` (Integer): Controls how many tokens are used in the response.
|
| 199 |
+
- `top_p` (Float): Controls the diversity of word selection. A higher value (closer to 1) makes word selection more diverse.
|
| 200 |
+
- `stream` (Boolean): Controls if the response is streamed back to the user (set to false).
|
| 201 |
+
- `prompt` (String): A prompt for the model to follow when generating responses, requires `$context` and `$query` variables.
|
| 202 |
+
- `system_prompt` (String): A system prompt for the model to follow when generating responses, in this case, it's set to the style of William Shakespeare.
|
| 203 |
+
- `stream` (Boolean): Controls if the response is streamed back to the user (set to false).
|
| 204 |
+
- `number_documents` (Integer): Number of documents to pull from the vectordb as context, defaults to 1
|
| 205 |
+
- `api_key` (String): The API key for the language model.
|
| 206 |
+
- `model_kwargs` (Dict): Keyword arguments to pass to the language model. Used for `aws_bedrock` provider, since it requires different arguments for each model.
|
| 207 |
+
3. `vectordb` Section:
|
| 208 |
+
- `provider` (String): The provider for the vector database, set to 'chroma'. You can find the full list of vector database providers in [our docs](/components/vector-databases).
|
| 209 |
+
- `config`:
|
| 210 |
+
- `collection_name` (String): The initial collection name for the vectordb, set to 'full-stack-app'.
|
| 211 |
+
- `dir` (String): The directory for the local database, set to 'db'.
|
| 212 |
+
- `allow_reset` (Boolean): Indicates whether resetting the vectordb is allowed, set to true.
|
| 213 |
+
<Note>We recommend you to checkout vectordb specific config [here](https://docs.embedchain.ai/components/vector-databases)</Note>
|
| 214 |
+
4. `embedder` Section:
|
| 215 |
+
- `provider` (String): The provider for the embedder, set to 'openai'. You can find the full list of embedding model providers in [our docs](/components/embedding-models).
|
| 216 |
+
- `config`:
|
| 217 |
+
- `model` (String): The specific model used for text embedding, 'text-embedding-ada-002'.
|
| 218 |
+
- `vector_dimension` (Integer): The vector dimension of the embedding model. [Defaults](https://github.com/embedchain/embedchain/blob/e572b5a3dc1b66f1e9b3357d11a88c63b5ce06e3/embedchain/models/vector_dimensions.py)
|
| 219 |
+
- `api_key` (String): The API key for the embedding model.
|
| 220 |
+
- `deployment_name` (String): The deployment name for the embedding model.
|
| 221 |
+
- `title` (String): The title for the embedding model for Google Embedder.
|
| 222 |
+
- `task_type` (String): The task type for the embedding model for Google Embedder.
|
| 223 |
+
5. `chunker` Section:
|
| 224 |
+
- `chunk_size` (Integer): The size of each chunk of text that is sent to the language model.
|
| 225 |
+
- `chunk_overlap` (Integer): The amount of overlap between each chunk of text.
|
| 226 |
+
- `length_function` (String): The function used to calculate the length of each chunk of text. In this case, it's set to 'len'. You can also use any function import directly as a string here.
|
| 227 |
+
- `min_chunk_size` (Integer): The minimum size of each chunk of text that is sent to the language model. Must be less than `chunk_size`, and greater than `chunk_overlap`.
|
| 228 |
+
6. `cache` Section: (Optional)
|
| 229 |
+
- `similarity_evaluation` (Optional): The config for similarity evaluation strategy. If not provided, the default `distance` based similarity evaluation strategy is used.
|
| 230 |
+
- `strategy` (String): The strategy to use for similarity evaluation. Currently, only `distance` and `exact` based similarity evaluation is supported. Defaults to `distance`.
|
| 231 |
+
- `max_distance` (Float): The bound of maximum distance. Defaults to `1.0`.
|
| 232 |
+
- `positive` (Boolean): If the larger distance indicates more similar of two entities, set it `True`, otherwise `False`. Defaults to `False`.
|
| 233 |
+
- `config` (Optional): The config for initializing the cache. If not provided, sensible default values are used as mentioned below.
|
| 234 |
+
- `similarity_threshold` (Float): The threshold for similarity evaluation. Defaults to `0.8`.
|
| 235 |
+
- `auto_flush` (Integer): The number of queries after which the cache is flushed. Defaults to `20`.
|
| 236 |
+
<Note>
|
| 237 |
+
If you provide a cache section, the app will automatically configure and use a cache to store the results of the language model. This is useful if you want to speed up the response time and save inference cost of your app.
|
| 238 |
+
</Note>
|
| 239 |
+
If you have questions about the configuration above, please feel free to reach out to us using one of the following methods:
|
| 240 |
+
|
| 241 |
+
<Snippet file="get-help.mdx" />
|
docs/api-reference/app/add.mdx
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: '📊 add'
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
`add()` method is used to load the data sources from different data sources to a RAG pipeline. You can find the signature below:
|
| 6 |
+
|
| 7 |
+
### Parameters
|
| 8 |
+
|
| 9 |
+
<ParamField path="source" type="str">
|
| 10 |
+
The data to embed, can be a URL, local file or raw content, depending on the data type.. You can find the full list of supported data sources [here](/components/data-sources/overview).
|
| 11 |
+
</ParamField>
|
| 12 |
+
<ParamField path="data_type" type="str" optional>
|
| 13 |
+
Type of data source. It can be automatically detected but user can force what data type to load as.
|
| 14 |
+
</ParamField>
|
| 15 |
+
<ParamField path="metadata" type="dict" optional>
|
| 16 |
+
Any metadata that you want to store with the data source. Metadata is generally really useful for doing metadata filtering on top of semantic search to yield faster search and better results.
|
| 17 |
+
</ParamField>
|
| 18 |
+
|
| 19 |
+
## Usage
|
| 20 |
+
|
| 21 |
+
### Load data from webpage
|
| 22 |
+
|
| 23 |
+
```python Code example
|
| 24 |
+
from embedchain import App
|
| 25 |
+
|
| 26 |
+
app = App()
|
| 27 |
+
app.add("https://www.forbes.com/profile/elon-musk")
|
| 28 |
+
# Inserting batches in chromadb: 100%|███████████████| 1/1 [00:00<00:00, 1.19it/s]
|
| 29 |
+
# Successfully saved https://www.forbes.com/profile/elon-musk (DataType.WEB_PAGE). New chunks count: 4
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
### Load data from sitemap
|
| 33 |
+
|
| 34 |
+
```python Code example
|
| 35 |
+
from embedchain import App
|
| 36 |
+
|
| 37 |
+
app = App()
|
| 38 |
+
app.add("https://python.langchain.com/sitemap.xml", data_type="sitemap")
|
| 39 |
+
# Loading pages: 100%|█████████████| 1108/1108 [00:47<00:00, 23.17it/s]
|
| 40 |
+
# Inserting batches in chromadb: 100%|█████████| 111/111 [04:41<00:00, 2.54s/it]
|
| 41 |
+
# Successfully saved https://python.langchain.com/sitemap.xml (DataType.SITEMAP). New chunks count: 11024
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
You can find complete list of supported data sources [here](/components/data-sources/overview).
|
docs/api-reference/app/chat.mdx
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: '💬 chat'
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
`chat()` method allows you to chat over your data sources using a user-friendly chat API. You can find the signature below:
|
| 6 |
+
|
| 7 |
+
### Parameters
|
| 8 |
+
|
| 9 |
+
<ParamField path="input_query" type="str">
|
| 10 |
+
Question to ask
|
| 11 |
+
</ParamField>
|
| 12 |
+
<ParamField path="config" type="BaseLlmConfig" optional>
|
| 13 |
+
Configure different llm settings such as prompt, temprature, number_documents etc.
|
| 14 |
+
</ParamField>
|
| 15 |
+
<ParamField path="dry_run" type="bool" optional>
|
| 16 |
+
The purpose is to test the prompt structure without actually running LLM inference. Defaults to `False`
|
| 17 |
+
</ParamField>
|
| 18 |
+
<ParamField path="where" type="dict" optional>
|
| 19 |
+
A dictionary of key-value pairs to filter the chunks from the vector database. Defaults to `None`
|
| 20 |
+
</ParamField>
|
| 21 |
+
<ParamField path="session_id" type="str" optional>
|
| 22 |
+
Session ID of the chat. This can be used to maintain chat history of different user sessions. Default value: `default`
|
| 23 |
+
</ParamField>
|
| 24 |
+
<ParamField path="citations" type="bool" optional>
|
| 25 |
+
Return citations along with the LLM answer. Defaults to `False`
|
| 26 |
+
</ParamField>
|
| 27 |
+
|
| 28 |
+
### Returns
|
| 29 |
+
|
| 30 |
+
<ResponseField name="answer" type="str | tuple">
|
| 31 |
+
If `citations=False`, return a stringified answer to the question asked. <br />
|
| 32 |
+
If `citations=True`, returns a tuple with answer and citations respectively.
|
| 33 |
+
</ResponseField>
|
| 34 |
+
|
| 35 |
+
## Usage
|
| 36 |
+
|
| 37 |
+
### With citations
|
| 38 |
+
|
| 39 |
+
If you want to get the answer to question and return both answer and citations, use the following code snippet:
|
| 40 |
+
|
| 41 |
+
```python With Citations
|
| 42 |
+
from embedchain import App
|
| 43 |
+
|
| 44 |
+
# Initialize app
|
| 45 |
+
app = App()
|
| 46 |
+
|
| 47 |
+
# Add data source
|
| 48 |
+
app.add("https://www.forbes.com/profile/elon-musk")
|
| 49 |
+
|
| 50 |
+
# Get relevant answer for your query
|
| 51 |
+
answer, sources = app.chat("What is the net worth of Elon?", citations=True)
|
| 52 |
+
print(answer)
|
| 53 |
+
# Answer: The net worth of Elon Musk is $221.9 billion.
|
| 54 |
+
|
| 55 |
+
print(sources)
|
| 56 |
+
# [
|
| 57 |
+
# (
|
| 58 |
+
# 'Elon Musk PROFILEElon MuskCEO, Tesla$247.1B$2.3B (0.96%)Real Time Net Worthas of 12/7/23 ...',
|
| 59 |
+
# {
|
| 60 |
+
# 'url': 'https://www.forbes.com/profile/elon-musk',
|
| 61 |
+
# 'score': 0.89,
|
| 62 |
+
# ...
|
| 63 |
+
# }
|
| 64 |
+
# ),
|
| 65 |
+
# (
|
| 66 |
+
# '74% of the company, which is now called X.Wealth HistoryHOVER TO REVEAL NET WORTH BY YEARForbes ...',
|
| 67 |
+
# {
|
| 68 |
+
# 'url': 'https://www.forbes.com/profile/elon-musk',
|
| 69 |
+
# 'score': 0.81,
|
| 70 |
+
# ...
|
| 71 |
+
# }
|
| 72 |
+
# ),
|
| 73 |
+
# (
|
| 74 |
+
# 'founded in 2002, is worth nearly $150 billion after a $750 million tender offer in June 2023 ...',
|
| 75 |
+
# {
|
| 76 |
+
# 'url': 'https://www.forbes.com/profile/elon-musk',
|
| 77 |
+
# 'score': 0.73,
|
| 78 |
+
# ...
|
| 79 |
+
# }
|
| 80 |
+
# )
|
| 81 |
+
# ]
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
<Note>
|
| 85 |
+
When `citations=True`, note that the returned `sources` are a list of tuples where each tuple has two elements (in the following order):
|
| 86 |
+
1. source chunk
|
| 87 |
+
2. dictionary with metadata about the source chunk
|
| 88 |
+
- `url`: url of the source
|
| 89 |
+
- `doc_id`: document id (used for book keeping purposes)
|
| 90 |
+
- `score`: score of the source chunk with respect to the question
|
| 91 |
+
- other metadata you might have added at the time of adding the source
|
| 92 |
+
</Note>
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
### Without citations
|
| 96 |
+
|
| 97 |
+
If you just want to return answers and don't want to return citations, you can use the following example:
|
| 98 |
+
|
| 99 |
+
```python Without Citations
|
| 100 |
+
from embedchain import App
|
| 101 |
+
|
| 102 |
+
# Initialize app
|
| 103 |
+
app = App()
|
| 104 |
+
|
| 105 |
+
# Add data source
|
| 106 |
+
app.add("https://www.forbes.com/profile/elon-musk")
|
| 107 |
+
|
| 108 |
+
# Chat on your data using `.chat()`
|
| 109 |
+
answer = app.chat("What is the net worth of Elon?")
|
| 110 |
+
print(answer)
|
| 111 |
+
# Answer: The net worth of Elon Musk is $221.9 billion.
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
### With session id
|
| 115 |
+
|
| 116 |
+
If you want to maintain chat sessions for different users, you can simply pass the `session_id` keyword argument. See the example below:
|
| 117 |
+
|
| 118 |
+
```python With session id
|
| 119 |
+
from embedchain import App
|
| 120 |
+
|
| 121 |
+
app = App()
|
| 122 |
+
app.add("https://www.forbes.com/profile/elon-musk")
|
| 123 |
+
|
| 124 |
+
# Chat on your data using `.chat()`
|
| 125 |
+
app.chat("What is the net worth of Elon Musk?", session_id="user1")
|
| 126 |
+
# 'The net worth of Elon Musk is $250.8 billion.'
|
| 127 |
+
app.chat("What is the net worth of Bill Gates?", session_id="user2")
|
| 128 |
+
# "I don't know the current net worth of Bill Gates."
|
| 129 |
+
app.chat("What was my last question", session_id="user1")
|
| 130 |
+
# 'Your last question was "What is the net worth of Elon Musk?"'
|
| 131 |
+
```
|
| 132 |
+
|
| 133 |
+
### With custom context window
|
| 134 |
+
|
| 135 |
+
If you want to customize the context window that you want to use during chat (default context window is 3 document chunks), you can do using the following code snippet:
|
| 136 |
+
|
| 137 |
+
```python with custom chunks size
|
| 138 |
+
from embedchain import App
|
| 139 |
+
from embedchain.config import BaseLlmConfig
|
| 140 |
+
|
| 141 |
+
app = App()
|
| 142 |
+
app.add("https://www.forbes.com/profile/elon-musk")
|
| 143 |
+
|
| 144 |
+
query_config = BaseLlmConfig(number_documents=5)
|
| 145 |
+
app.chat("What is the net worth of Elon Musk?", config=query_config)
|
| 146 |
+
```
|