Skip to content

Commit d30a2b1

Browse files
authored
Ingest v2: Zendesk source connector (#513)
1 parent 7370c28 commit d30a2b1

File tree

7 files changed

+126
-1
lines changed

7 files changed

+126
-1
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: Zendesk
3+
---
4+
5+
import NewDocument from '/snippets/general-shared-text/new-document.mdx';
6+
7+
<NewDocument />
8+
9+
import SharedContentZendesk from '/snippets/sc-shared-text/zendesk-cli-api.mdx';
10+
11+
<SharedContentZendesk/>
12+
13+
Now call the Unstructured Ingest CLI or the Unstructured Ingest Python library. The destination connector can be any of the ones supported. This example uses the local destination connector.
14+
15+
This example sends data to Unstructured for processing by default. To process data locally instead, see the instructions at the end of this page.
16+
17+
import ZendeskSh from '/snippets/source_connectors/zendesk.sh.mdx';
18+
import ZendeskPyV2 from '/snippets/source_connectors/zendesk.v2.py.mdx';
19+
20+
<CodeGroup>
21+
<ZendeskSh />
22+
<ZendeskPyV2 />
23+
</CodeGroup>
24+
25+
import SharedPartitionByAPIOSS from '/snippets/ingest-configuration-shared/partition-by-api-oss.mdx';
26+
27+
<SharedPartitionByAPIOSS/>

mint.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,8 @@
443443
"ingestion/source-connectors/slack",
444444
"ingestion/source-connectors/snowflake",
445445
"ingestion/source-connectors/sqlite",
446-
"ingestion/source-connectors/wikipedia"
446+
"ingestion/source-connectors/wikipedia",
447+
"ingestion/source-connectors/zendesk"
447448
]
448449
},
449450
{
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
The Zendesk connector dependencies:
2+
3+
```bash CLI, Python
4+
pip install "unstructured-ingest[zendesk]"
5+
```
6+
7+
import AdditionalIngestDependencies from '/snippets/general-shared-text/ingest-dependencies.mdx';
8+
9+
<AdditionalIngestDependencies />
10+
11+
The following environment variables:
12+
13+
- `ZENDESK_SUBDOMAIN` - The subdomain for your Zendesk account, represented by `--subdomain` (CLI) or `subdomain` (Python).
14+
- `ZENDESK_EMAIL` - The login email address for your Zendesk account, represented by `--email` (CLI) or `email` (Python).
15+
- `ZENDESK_API_TOKEN` - The API token (not OAuth token) for your login email address, represented by `--api-token` (CLI) or `api_token` (Python).
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- A [Zendesk account](https://www.zendesk.com/register/).
2+
- Your [Zendesk subdomain](https://support.zendesk.com/hc/en-us/articles/4409381383578-Where-can-I-find-my-Zendesk-subdomain).
3+
- The login email address for your Zendesk account.
4+
- An [API token](https://support.zendesk.com/hc/en-us/articles/4408889192858-Managing-access-to-the-Zendesk-API#topic_tcb_fk1_2yb) (not an OAuth token) for your login email address.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Connect Zendesk to your preprocessing pipeline, and use the Unstructured CLI or Python to batch process all your documents and store structured outputs locally on your filesystem.
2+
3+
The requirements are as follows.
4+
5+
import SharedZendesk from '/snippets/general-shared-text/zendesk.mdx';
6+
import SharedZendeskCLIAPI from '/snippets/general-shared-text/zendesk-cli-api.mdx';
7+
8+
<SharedZendesk />
9+
<SharedZendeskCLIAPI />
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
```bash CLI
2+
#!/usr/bin/env bash
3+
4+
# Chunking and embedding are optional.
5+
6+
unstructured-ingest \
7+
zendesk \
8+
--subdomain $ZENDESK_SUBDOMAIN \
9+
--email $ZENDESK_EMAIL \
10+
--api-token $ZENDESK_API_TOKEN \
11+
--batch-size 2 \
12+
--item-type tickets \
13+
--output-dir $LOCAL_FILE_OUTPUT_DIR \
14+
--partition-by-api \
15+
--api-key $UNSTRUCTURED_API_KEY \
16+
--partition-endpoint $UNSTRUCTURED_API_URL \
17+
--chunking-strategy by_title \
18+
--embedding-provider huggingface
19+
```
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
```python Python Ingest v2
2+
import os
3+
4+
from unstructured_ingest.v2.pipeline.pipeline import Pipeline
5+
from unstructured_ingest.v2.interfaces import ProcessorConfig
6+
7+
from unstructured_ingest.v2.processes.connectors.zendesk import (
8+
ZendeskIndexerConfig,
9+
ZendeskDownloaderConfig,
10+
ZendeskConnectionConfig,
11+
ZendeskAccessConfig
12+
)
13+
14+
from unstructured_ingest.v2.processes.partitioner import PartitionerConfig
15+
from unstructured_ingest.v2.processes.chunker import ChunkerConfig
16+
from unstructured_ingest.v2.processes.embedder import EmbedderConfig
17+
from unstructured_ingest.v2.processes.connectors.local import LocalUploaderConfig
18+
19+
# Chunking and embedding are optional.
20+
21+
if __name__ == "__main__":
22+
Pipeline.from_configs(
23+
context=ProcessorConfig(),
24+
indexer_config=ZendeskIndexerConfig(
25+
batch_size=2,
26+
item_type=["tickets"]
27+
),
28+
downloader_config=ZendeskDownloaderConfig(download_dir=os.getenv("LOCAL_FILE_DOWNLOAD_DIR")),
29+
source_connection_config=ZendeskConnectionConfig(
30+
access_config=ZendeskAccessConfig(
31+
api_token=os.getenv("ZENDESK_API_TOKEN")
32+
),
33+
subdomain=os.getenv("ZENDESK_SUBDOMAIN"),
34+
email=os.getenv("ZENDESK_EMAIL")
35+
),
36+
partitioner_config=PartitionerConfig(
37+
partition_by_api=True,
38+
api_key=os.getenv("UNSTRUCTURED_API_KEY"),
39+
partition_endpoint=os.getenv("UNSTRUCTURED_API_URL"),
40+
additional_partition_args={
41+
"split_pdf_page": True,
42+
"split_pdf_allow_failed": True,
43+
"split_pdf_concurrency_level": 15
44+
}
45+
),
46+
chunker_config=ChunkerConfig(chunking_strategy="by_title"),
47+
embedder_config=EmbedderConfig(embedding_provider="huggingface"),
48+
uploader_config=LocalUploaderConfig(output_dir=os.getenv("LOCAL_FILE_OUTPUT_DIR"))
49+
).run()
50+
```

0 commit comments

Comments
 (0)