Giter VIP home page Giter VIP logo

baml-examples's Introduction

baml-examples

This repository contains BAML example code used in the Documentation Tutorials. Check them out first to get started!

Clone the repo to see syntax highlights using the BAML VSCode extension!

Requirements

  1. BAML CLI,
  2. BAML VSCode extension
  3. OPENAI_API_KEY is set in your .env file. See .env.example at the root.

Contact us on Discord if you need help running the examples using Conda, pip or another dependency mgmt.

Setup

We recommend running baml init in your own project (unless you just want to clone the NextJS or FastAPI starter projects). Then just copy the .baml files and functions you want.

Make sure you can ctrl + s one of the .baml files after you install the BAML VSCode extension to generate a baml_client dir.

Troubleshooting

If you're having issues, reach out to us on Discord (https://discord.gg/yzaTpQ3tdT).

Some common steps that help fix things:

  1. Make sure you also add baml pip package to the project dependencies if you are not using poetry (see pyproject.toml for dependency list).
  2. Make sure you're in a poetry shell when you run the python main.py files.
  3. Enable Python > Analysis: Type Checking Mode - Basic or greater.
  4. Make sure environment variables are set (some baml files use an env.OPEN_AI_KEY). Add a .env file to the root dir with the appropriate api key set to fix this.
  5. Restart VScode if the playground isn't working
  6. Restart VSCode if you're not getting error highlights for baml-generated code, or ensure the right Python interpreter is set (Command + Shift + P -> Select interpreter)

baml-examples's People

Contributors

aaronvg avatar hellovai avatar dependabot[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

ayusha0215

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.