ShadAI Framework
  1. api-reference
ShadAI Framework
  • Index
  • README
  • Pricing
    • Pricing Plan
  • advanced
    • Best Practices
    • Tool Orchestration
    • Performance Optimization
    • Custom Tools
  • examples
    • Advanced Patterns
    • Custom Agent Examples
    • Market Research Examples
    • Multi-Document Analysis
    • Basic Query Examples
  • api-reference
    • Exceptions Reference
    • Engine Tool API
    • Shadai Client API Reference
    • Query Tool API
    • Summarize Tool API
    • Agent Tool API
    • Web Search Tool API
  • use-cases
    • Knowledge Synthesis
    • Research Assistant
    • Custom Workflows
    • Document Q&A
  • core-concepts
    • Architecture
    • Intelligent Agent
    • RAG System
    • Tools Overview
  • guides
    • Memory & Context
    • Streaming Responses
    • File Ingestion
    • Error Handling
    • Session Management
  • getting-started
    • Authentication
    • Your First Query
    • Quick Start
    • Installation
  1. api-reference

Shadai Client API Reference

Complete reference for the main Shadai client class.

Class: Shadai#

Main entry point for interacting with Shadai services.

Constructor#

Parameters:
ParameterTypeDefaultDescription
namestrNoneSession name (required if not temporal)
temporalboolFalseCreate temporary session (auto-deleted)
api_keystrNoneAPI key (reads from env if not provided)
base_urlstr"http://localhost"Shadai server URL
timeoutint30Request timeout in seconds
Examples:

Methods#

ingest()#

Ingest documents from a folder into the session.
Parameters:
folder_path (str): Path to folder containing documents
Returns:
Example:

query()#

Query the knowledge base.
Parameters:
query (str): Question to ask
use_memory (bool): Enable conversation memory (default: True)
Returns: Async iterator of response chunks
Example:

summarize()#

Generate summary of all documents.
Parameters:
use_memory (bool): Enable conversation memory (default: True)
Returns: Async iterator of summary chunks
Example:

web_search()#

Search the web for information.
Parameters:
prompt (str): Search query
use_web_search (bool): Enable web search (default: True)
use_memory (bool): Enable conversation memory (default: True)
Returns: Async iterator of response chunks
Example:

engine()#

Multi-tool orchestration.
Parameters:
prompt (str): Query or task
use_knowledge_base (bool): Query documents (default: False)
use_summary (bool): Include summary (default: False)
use_web_search (bool): Search web (default: False)
use_memory (bool): Enable memory (default: True)
Returns: Async iterator of response chunks
Example:

agent()#

Execute custom tool workflow.
Parameters:
prompt (str): Task description
tools (List[Callable]): List of custom tools
Returns: Async iterator of response chunks
Example:

get_session_history()#

Retrieve conversation history.
Parameters:
page (int): Page number (default: 1)
page_size (int): Messages per page (default: 5, max: 10)
Returns:
Example:

clear_session_history()#

Clear all conversation history.
Returns:
Example:

Context Manager#

Shadai supports async context manager protocol:
Equivalent to:

Next Steps#

Tool-Specific APIs
Exceptions Reference
Modified at 2025-10-17 17:46:10
Previous
Engine Tool API
Next
Query Tool API
Built with