From df679987391f4cbce3873aa4cb8737d64b1fb433 Mon Sep 17 00:00:00 2001 From: krankos Date: Tue, 29 Jul 2025 17:51:22 +0100 Subject: [PATCH] chore: add missing config files for typescript quickstart in the readme --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index cf14c6a9..a6a57a7c 100644 --- a/README.md +++ b/README.md @@ -181,6 +181,37 @@ def vegetarian_recipe_agent(messages) -> scenario.AgentReturnTypes:
Quick Start - TypeScript +Setup `scenario.config.js` or `scenario.config.mjs` at the root of your project. + +```typescript +import { openai } from "@ai-sdk/openai"; +import { defineConfig } from "@langwatch/scenario"; + +export default defineConfig({ + defaultModel: { + model: openai("gpt-4.1"), + }, +}); +``` + +Setup `vitest.config.ts` or `vitest.config.mts` at the root of your project. This is important to enable autopilot simulation. + +```typescript +import { withScenario } from "@langwatch/scenario/integrations/vitest/config"; +import VitestReporter from "@langwatch/scenario/integrations/vitest/reporter"; +import { defineConfig } from "vitest/config"; + +export default withScenario( + defineConfig({ + test: { + testTimeout: 180_000, // 3 minutes + setupFiles: ["dotenv/config"], + reporters: ["default", new VitestReporter()], + }, + }) +); +``` + Save it as `tests/vegetarian-recipe-agent.test.ts`: ```typescript