File: basic_usage.py
Get started with common operations:
- List stages, repositories, and connectors
- Fetch specific resources by ID
- List files in a stage
cd pharia/examples
python basic_usage.pyFile: create_stages.py
Comprehensive guide to creating stages with different embedding types:
| Type | Use Case |
|---|---|
| Simple | No embedding, just data storage |
| Instruct | Custom instruction-based embeddings |
| Semantic | Asymmetric/symmetric semantic search |
| VLLM | VLLM-based embedding models |
Each example creates a stage and automatically cleans it up.
cd pharia/examples
python create_stages.pyFile: search_stores_usage.py
Full search store lifecycle including the Filter DSL:
- Create search stores (semantic, instruct)
- Add documents and search with metadata filters
- Use
Filter,And,Or,Not, andModalityConditionfor Pythonic queries
cd pharia/examples
python search_stores_usage.pyFile: typed_usage.py
Learn how to use TypedDict annotations for:
- Better IDE autocomplete
- Type checking with mypy
- Safer, more maintainable code
cd pharia/examples
python typed_usage.pySet your credentials via environment variables:
export PHARIA_DATA_API_BASE_URL="https://<base-url>"
export PHARIA_API_KEY="your-api-key-here"The client will automatically read these values. No code changes needed!
- ✅ Most examples are read-only and safe to run
- ✅
create_stages.pycreates resources but auto-cleans them - ✅ All examples use the staging environment by default
- ✅ Install the SDK first:
uv syncfrompharia/directory
Learn by doing • Back to main README