Substrate Python and TypeScript examples.
- Basics – Get started with basic examples.
- Techniques – Prompting techniques (Tree of Thought, Mixture of Agents), RAG techniques, and more.
- Tutorials – Integrated use cases, like multi-turn conversations (chat).
Get your API key from the Substrate Dashboard, and set it as an environment variable:
export SUBSTRATE_API_KEY=ENTER_YOUR_KEY
To run the Python examples, first install dependencies in the root directory.
poetry install --no-root
First, navigate to an example directory for your language. Then run:
# Run a TypeScript example
npm install # Install dependencies
npm start # Run example.ts
# Run a Python example
# Note: First install dependencies in the root directory (see above).
poetry run python example.py # Run example.py