Skip to content

SubstrateLabs/substrate-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Substrate examples

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).

Getting started

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

Run examples

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