Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 1.09 KB

README.md

File metadata and controls

35 lines (24 loc) · 1.09 KB

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