This is an example project demonstrating how to use Galileo experiments with applications that use RAG and tools.
This code is used in the Run an experiment against a RAG app how-to guide in the Galileo documentation.
Install the dependencies:
npm iYou will need to configure environment variables to use this project. Copy the .env.example file to .env, then update the environment variables in the .env file with your OpenAI and Galileo values:
# Galileo environment variables
GALILEO_API_KEY=
GALILEO_PROJECT=
GALILEO_LOG_STREAM=
# OpenAI environment variables
OPENAI_API_KEY=This sample contains both an application that generates a fake horoscope using a tool and a mock RAG function, as well as an experiment to test the same code.
To run the application, run:
npx tsx app.tsTraces will be captured and logged to Galileo.
To run the experiment, run:
npx tsx experiment.tsA link to the results of the experiment will be written to the console.
The project structure is as follows:
rag-and-tools/
├── env.example # List of environment variables
├── package.json # NPM project requirements
├── package-lock.json # NPM project requirements
├── app.ts # The main python application
├── experiment.ts # Code to run the main application as an experiment
└── README.md # Project documentation