-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: enabled listing for docs snippets #1143
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ In this blog post, we'll guide you through the process of building a RAG applica | |
|
||
Create a new folder for your project and install Verba: | ||
|
||
```bash | ||
```sh | ||
mkdir verba-dlt-zendesk | ||
cd verba-dlt-zendesk | ||
python -m venv venv | ||
|
@@ -50,7 +50,7 @@ pip install goldenverba | |
|
||
To configure Verba, we need to set the following environment variables: | ||
|
||
```bash | ||
```sh | ||
VERBA_URL=https://your-cluster.weaviate.network # your Weaviate instance URL | ||
VERBA_API_KEY=F8...i4WK # the API key of your Weaviate instance | ||
OPENAI_API_KEY=sk-...R # your OpenAI API key | ||
|
@@ -61,13 +61,13 @@ You can put them in a `.env` file in the root of your project or export them in | |
|
||
Let's test that Verba is installed correctly: | ||
|
||
```bash | ||
```sh | ||
verba start | ||
``` | ||
|
||
You should see the following output: | ||
|
||
```bash | ||
```sh | ||
INFO: Uvicorn running on <http://0.0.0.0:8000> (Press CTRL+C to quit) | ||
ℹ Setting up client | ||
✔ Client connected to Weaviate Cluster | ||
|
@@ -88,23 +88,23 @@ If you try to ask a question now, you'll get an error in return. That's because | |
|
||
We get our data from Zendesk using dlt. Let's install it along with the Weaviate extra: | ||
|
||
```bash | ||
```sh | ||
pip install "dlt[weaviate]" | ||
``` | ||
|
||
This also installs a handy CLI tool called `dlt`. It will help us initialize the [Zendesk verified data source](https://dlthub.com/docs/dlt-ecosystem/verified-sources/zendesk)—a connector to Zendesk Support API. | ||
|
||
Let's initialize the verified source: | ||
|
||
```bash | ||
```sh | ||
dlt init zendesk weaviate | ||
``` | ||
|
||
`dlt init` pulls the latest version of the connector from the [verified source repository](https://github.com/dlt-hub/verified-sources) and creates a credentials file for it. The credentials file is called `secrets.toml` and it's located in the `.dlt` directory. | ||
|
||
To make things easier, we'll use the email address and password authentication method for Zendesk API. Let's add our credentials to `secrets.toml`: | ||
|
||
```yaml | ||
```toml | ||
[sources.zendesk.credentials] | ||
password = "your-password" | ||
subdomain = "your-subdomain" | ||
|
@@ -113,14 +113,13 @@ email = "[email protected]" | |
|
||
We also need to specify the URL and the API key of our Weaviate instance. Copy the credentials for the Weaviate instance you created earlier and add them to `secrets.toml`: | ||
|
||
```yaml | ||
```toml | ||
[destination.weaviate.credentials] | ||
url = "https://your-cluster.weaviate.network" | ||
api_key = "F8.....i4WK" | ||
|
||
[destination.weaviate.credentials.additional_headers] | ||
X-OpenAI-Api-Key = "sk-....." | ||
|
||
``` | ||
|
||
All the components are now in place and configured. Let's set up a pipeline to import data from Zendesk. | ||
|
@@ -129,7 +128,7 @@ All the components are now in place and configured. Let's set up a pipeline to i | |
|
||
Open your favorite text editor and create a file called `zendesk_verba.py`. Add the following code to it: | ||
|
||
```python | ||
```py | ||
import itertools | ||
|
||
import dlt | ||
|
@@ -217,13 +216,13 @@ Finally, we run the pipeline and print the load info. | |
|
||
Let's run the pipeline: | ||
|
||
```bash | ||
```sh | ||
python zendesk_verba.py | ||
``` | ||
|
||
You should see the following output: | ||
|
||
```bash | ||
```sh | ||
Pipeline zendesk_verba completed in 8.27 seconds | ||
1 load package(s) were loaded to destination weaviate and into dataset None | ||
The weaviate destination used <https://your-cluster.weaviate.network> location to store data | ||
|
@@ -235,13 +234,13 @@ Verba is now populated with data from Zendesk Support. However there are a coupl | |
|
||
Run the following command: | ||
|
||
```bash | ||
```sh | ||
verba init | ||
``` | ||
|
||
You should see the following output: | ||
|
||
```bash | ||
```sh | ||
===================== Creating Document and Chunk class ===================== | ||
ℹ Setting up client | ||
✔ Client connected to Weaviate Cluster | ||
|
@@ -264,7 +263,7 @@ Document class already exists, do you want to overwrite it? (y/n): n | |
|
||
We're almost there! Let's start Verba: | ||
|
||
```bash | ||
```sh | ||
verba start | ||
``` | ||
|
||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't you use glob?
https://docs.python.org/3/library/glob.html