docs: app config instead of init config (#308)

This commit is contained in:
cachho
2023-07-18 09:16:06 +02:00
committed by GitHub
parent 1df804e7df
commit 96143ac496
4 changed files with 7 additions and 6 deletions

View File

@@ -13,11 +13,12 @@ Here's the readme example with configuration options.
```python ```python
import os import os
from embedchain import App from embedchain import App
from embedchain.config import InitConfig, AddConfig, QueryConfig, ChunkerConfig from embedchain.config import AppConfig, AddConfig, QueryConfig, ChunkerConfig
from chromadb.utils import embedding_functions from chromadb.utils import embedding_functions
# Example: use your own embedding function # Example: use your own embedding function
config = InitConfig(ef=embedding_functions.OpenAIEmbeddingFunction( # Warning: We are currenty reworking the concept of custom apps, this might not be working.
config = AppConfig(ef=embedding_functions.OpenAIEmbeddingFunction(
api_key=os.getenv("OPENAI_API_KEY"), api_key=os.getenv("OPENAI_API_KEY"),
organization_id=os.getenv("OPENAI_ORGANIZATION"), organization_id=os.getenv("OPENAI_ORGANIZATION"),
model_name="text-embedding-ada-002" model_name="text-embedding-ada-002"

View File

@@ -2,7 +2,7 @@
title: '🔍 Query configurations' title: '🔍 Query configurations'
--- ---
## InitConfig ## AppConfig
| option | description | type | default | | option | description | type | default |
|-----------|-----------------------|---------------------------------|------------------------| |-----------|-----------------------|---------------------------------|------------------------|

View File

@@ -19,7 +19,7 @@ class OpenSourceApp(EmbedChain):
def __init__(self, config: OpenSourceAppConfig = None): def __init__(self, config: OpenSourceAppConfig = None):
""" """
:param config: InitConfig instance to load as configuration. Optional. :param config: OpenSourceAppConfig instance to load as configuration. Optional.
`ef` defaults to open source. `ef` defaults to open source.
""" """
logging.info("Loading open source embedding model. This may take some time...") # noqa:E501 logging.info("Loading open source embedding model. This may take some time...") # noqa:E501

View File

@@ -34,13 +34,13 @@
"source": [ "source": [
"import os\n", "import os\n",
"from embedchain import App\n", "from embedchain import App\n",
"from embedchain.config import InitConfig\n", "from embedchain.config import AppConfig\n",
"\n", "\n",
"\n", "\n",
"chromadb_host = \"localhost\"\n", "chromadb_host = \"localhost\"\n",
"chromadb_port = 8000\n", "chromadb_port = 8000\n",
"\n", "\n",
"config = InitConfig(host=chromadb_host, port=chromadb_port)\n", "config = AppConfig(host=chromadb_host, port=chromadb_port)\n",
"elon_bot = App(config)" "elon_bot = App(config)"
] ]
}, },