[Improvements] improve package ux (#950)
Co-authored-by: Deven Patel <deven298@yahoo.com>
This commit is contained in:
8
configs/gpt4.yaml
Normal file
8
configs/gpt4.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
llm:
|
||||||
|
provider: openai
|
||||||
|
config:
|
||||||
|
model: 'gpt-4'
|
||||||
|
temperature: 0.5
|
||||||
|
max_tokens: 1000
|
||||||
|
top_p: 1
|
||||||
|
stream: false
|
||||||
@@ -83,3 +83,9 @@ app.deploy()
|
|||||||
# 🛠️ Adding data to your pipeline...
|
# 🛠️ Adding data to your pipeline...
|
||||||
# ✅ Data of type: web_page, value: https://www.forbes.com/profile/elon-musk added successfully.
|
# ✅ Data of type: web_page, value: https://www.forbes.com/profile/elon-musk added successfully.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can try it out yourself using the following Google Colab notebook:
|
||||||
|
|
||||||
|
<a href="https://colab.research.google.com/drive/17ON1LPonnXAtLaZEebnOktstB_1cJJmh?usp=sharing">
|
||||||
|
<img src="https://camo.githubusercontent.com/84f0493939e0c4de4e6dbe113251b4bfb5353e57134ffd9fcab6b8714514d4d1/68747470733a2f2f636f6c61622e72657365617263682e676f6f676c652e636f6d2f6173736574732f636f6c61622d62616467652e737667" alt="Open in Colab" />
|
||||||
|
</a>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class DiscourseLoader(BaseLoader):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def _load_post(self, post_id):
|
def _load_post(self, post_id):
|
||||||
post_url = f"{self.domain}/posts/{post_id}.json"
|
post_url = f"{self.domain}posts/{post_id}.json"
|
||||||
response = requests.get(post_url)
|
response = requests.get(post_url)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
response_data = response.json()
|
response_data = response.json()
|
||||||
@@ -53,7 +53,7 @@ class DiscourseLoader(BaseLoader):
|
|||||||
data = []
|
data = []
|
||||||
data_contents = []
|
data_contents = []
|
||||||
logging.info(f"Searching data on discourse url: {self.domain}, for query: {query}")
|
logging.info(f"Searching data on discourse url: {self.domain}, for query: {query}")
|
||||||
search_url = f"{self.domain}/search.json?q={query}"
|
search_url = f"{self.domain}search.json?q={query}"
|
||||||
response = requests.get(search_url)
|
response = requests.get(search_url)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
response_data = response.json()
|
response_data = response.json()
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ try:
|
|||||||
from langchain.document_loaders import UnstructuredFileLoader
|
from langchain.document_loaders import UnstructuredFileLoader
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise ImportError(
|
raise ImportError(
|
||||||
'PDF File requires extra dependencies. Install with `pip install --upgrade "embedchain[dataloaders]"`'
|
'Unstructured file requires extra dependencies. Install with `pip install --upgrade "embedchain[dataloaders]"`'
|
||||||
) from None
|
) from None
|
||||||
from embedchain.helper.json_serializable import register_deserializable
|
from embedchain.helper.json_serializable import register_deserializable
|
||||||
from embedchain.loaders.base_loader import BaseLoader
|
from embedchain.loaders.base_loader import BaseLoader
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "embedchain"
|
name = "embedchain"
|
||||||
version = "0.1.10"
|
version = "0.1.11"
|
||||||
description = "Data platform for LLMs - Load, index, retrieve and sync any unstructured data"
|
description = "Data platform for LLMs - Load, index, retrieve and sync any unstructured data"
|
||||||
authors = [
|
authors = [
|
||||||
"Taranjeet Singh <taranjeet@embedchain.ai>",
|
"Taranjeet Singh <taranjeet@embedchain.ai>",
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from embedchain.loaders.discourse import DiscourseLoader
|
|||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def discourse_loader_config():
|
def discourse_loader_config():
|
||||||
return {
|
return {
|
||||||
"domain": "https://example.com",
|
"domain": "https://example.com/",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -17,9 +17,9 @@ def discourse_loader(discourse_loader_config):
|
|||||||
|
|
||||||
|
|
||||||
def test_discourse_loader_init_with_valid_config():
|
def test_discourse_loader_init_with_valid_config():
|
||||||
config = {"domain": "https://example.com"}
|
config = {"domain": "https://example.com/"}
|
||||||
loader = DiscourseLoader(config=config)
|
loader = DiscourseLoader(config=config)
|
||||||
assert loader.domain == "https://example.com"
|
assert loader.domain == "https://example.com/"
|
||||||
|
|
||||||
|
|
||||||
def test_discourse_loader_init_with_missing_config():
|
def test_discourse_loader_init_with_missing_config():
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ CONFIG_YAMLS = [
|
|||||||
"configs/chunker.yaml",
|
"configs/chunker.yaml",
|
||||||
"configs/cohere.yaml",
|
"configs/cohere.yaml",
|
||||||
"configs/full-stack.yaml",
|
"configs/full-stack.yaml",
|
||||||
|
"configs/gpt4.yaml",
|
||||||
"configs/gpt4all.yaml",
|
"configs/gpt4all.yaml",
|
||||||
"configs/huggingface.yaml",
|
"configs/huggingface.yaml",
|
||||||
"configs/jina.yaml",
|
"configs/jina.yaml",
|
||||||
@@ -21,8 +22,7 @@ CONFIG_YAMLS = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class TestAllConfigYamls:
|
def test_all_config_yamls():
|
||||||
def test_all_config_yamls(self):
|
|
||||||
"""Test that all config yamls are valid."""
|
"""Test that all config yamls are valid."""
|
||||||
for config_yaml in CONFIG_YAMLS:
|
for config_yaml in CONFIG_YAMLS:
|
||||||
with open(config_yaml, "r") as f:
|
with open(config_yaml, "r") as f:
|
||||||
|
|||||||
Reference in New Issue
Block a user