Python SDK
The eGain API client SDK for Python offers a modern, type-safe interface for integrating with eGain’s Knowledge Portal Manager, AI Services, and Ingestion APIs.
License
The following licenses are required to use the SDK:
- If the user is an agent, then the Knowledge + AI license is required.
- If the user is a customer, the Self-Service and Advanced Self-Service licenses must be available.
API Resource Limits
The following Resources have predefined limits for specific access attributes for Enterprise use.
Resource | Attribute | Enterprise |
---|---|---|
Article Reference Limits | Number of attachments used in any article | 50 |
Number of custom attributes in an article | 15 | |
Number of publish views used in an article version | 20 | |
Topic Reference Limits | User-defined topics in a department | 50000 |
Depth of topics | 20 | |
Topics at any level | 2500 | |
Number of custom attributes in a topic | 15 | |
Portal Reference Limits | Tag categories in a portal | 15 |
Topics to be included in a portal | 2500 | |
Number of articles to display in announcements | 25 | |
Maximum related articles in portal setting | 100 | |
Usage links and link groups setup for a portal | 25 |
SDK Example Usage
Retrieve API
# Synchronous Example
from egain_api_python import Egain
import os
with Egain(
access_token=os.getenv("EGAIN_ACCESS_TOKEN", ""),
) as egain:
res = egain.aiservices.retrieve.retrieve_chunks(q="fair lending", portal_id="PROD-1000", dollar_filter_user_profile_id="PROD-3210", language="en-US", dollar_filter_tags={
"PROD-1234": [
"PROD-2000",
"PROD-2003",
],
"PROD-2005": [
"PROD-2007",
],
}, channel={
"name": "Eight Bank Website",
})
# Handle response
print(res)