diff --git a/configs/gpt4.yaml b/configs/gpt4.yaml new file mode 100644 index 00000000..e06c60de --- /dev/null +++ b/configs/gpt4.yaml @@ -0,0 +1,8 @@ +llm: + provider: openai + config: + model: 'gpt-4' + temperature: 0.5 + max_tokens: 1000 + top_p: 1 + stream: false \ No newline at end of file diff --git a/docs/get-started/quickstart.mdx b/docs/get-started/quickstart.mdx index 70491b6d..2179e0b2 100644 --- a/docs/get-started/quickstart.mdx +++ b/docs/get-started/quickstart.mdx @@ -83,3 +83,9 @@ app.deploy() # 🛠️ Adding data to your pipeline... # ✅ 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: + + + Open in Colab + diff --git a/embedchain/loaders/discourse.py b/embedchain/loaders/discourse.py index 4111b847..d26d1b5e 100644 --- a/embedchain/loaders/discourse.py +++ b/embedchain/loaders/discourse.py @@ -30,7 +30,7 @@ class DiscourseLoader(BaseLoader): ) 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.raise_for_status() response_data = response.json() @@ -53,7 +53,7 @@ class DiscourseLoader(BaseLoader): data = [] data_contents = [] 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.raise_for_status() response_data = response.json() diff --git a/embedchain/loaders/unstructured_file.py b/embedchain/loaders/unstructured_file.py index 1343a72d..9b491c4a 100644 --- a/embedchain/loaders/unstructured_file.py +++ b/embedchain/loaders/unstructured_file.py @@ -4,7 +4,7 @@ try: from langchain.document_loaders import UnstructuredFileLoader except 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 embedchain.helper.json_serializable import register_deserializable from embedchain.loaders.base_loader import BaseLoader diff --git a/pyproject.toml b/pyproject.toml index d35b1cc7..30e49c1a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "embedchain" -version = "0.1.10" +version = "0.1.11" description = "Data platform for LLMs - Load, index, retrieve and sync any unstructured data" authors = [ "Taranjeet Singh ", diff --git a/tests/loaders/test_discourse.py b/tests/loaders/test_discourse.py index 2949f0c9..8033450a 100644 --- a/tests/loaders/test_discourse.py +++ b/tests/loaders/test_discourse.py @@ -7,7 +7,7 @@ from embedchain.loaders.discourse import DiscourseLoader @pytest.fixture def discourse_loader_config(): 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(): - config = {"domain": "https://example.com"} + config = {"domain": "https://example.com/"} loader = DiscourseLoader(config=config) - assert loader.domain == "https://example.com" + assert loader.domain == "https://example.com/" def test_discourse_loader_init_with_missing_config(): diff --git a/tests/test_utils.py b/tests/test_utils.py index 722cda23..3ca05548 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -9,6 +9,7 @@ CONFIG_YAMLS = [ "configs/chunker.yaml", "configs/cohere.yaml", "configs/full-stack.yaml", + "configs/gpt4.yaml", "configs/gpt4all.yaml", "configs/huggingface.yaml", "configs/jina.yaml", @@ -21,16 +22,15 @@ CONFIG_YAMLS = [ ] -class TestAllConfigYamls: - def test_all_config_yamls(self): - """Test that all config yamls are valid.""" - for config_yaml in CONFIG_YAMLS: - with open(config_yaml, "r") as f: - config = yaml.safe_load(f) - assert config is not None +def test_all_config_yamls(): + """Test that all config yamls are valid.""" + for config_yaml in CONFIG_YAMLS: + with open(config_yaml, "r") as f: + config = yaml.safe_load(f) + assert config is not None - try: - validate_yaml_config(config) - except Exception as e: - print(f"Error in {config_yaml}: {e}") - raise e + try: + validate_yaml_config(config) + except Exception as e: + print(f"Error in {config_yaml}: {e}") + raise e