### Start Frontend Development Server (Manual Setup) Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/contributing/frontend.mdx Run this command to start the frontend development server after installing dependencies and configuring environment variables. ```bash npm run start ``` -------------------------------- ### Install and Run MCP Examples Source: https://github.com/comet-ml/opik/blob/main/sdks/opik_optimizer/README.md Install the MCP Python SDK using pip and run provided example scripts. ```bash # Install MCP Python SDK pip install mcp # Run MCP examples python scripts/litellm_metaprompt_context7_mcp_example.py python scripts/litellm_metaprompt_context7_remote_example.py ``` -------------------------------- ### Install Frontend Dependencies (Manual Setup) Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/contributing/frontend.mdx Navigate to the frontend application directory and run this command to install all necessary Node.js dependencies. ```bash cd apps/opik-frontend npm install ``` -------------------------------- ### Manual Infrastructure and Build Setup Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs-v2/contributing/guides/backend.mdx Commands to manually start infrastructure, build the backend, and run migrations. ```bash ./opik.sh --infra --port-mapping cd apps/opik-backend mvn clean install # MySQL migrations java -jar target/opik-backend-*.jar db migrate config.yml # ClickHouse migrations java -jar target/opik-backend-*.jar dbAnalytics migrate config.yml # Start the backend java -jar target/opik-backend-*.jar server config.yml ``` ```powershell .\opik.ps1 --infra --port-mapping cd apps\opik-backend mvn clean install # MySQL migrations java -jar target\opik-backend-*.jar db migrate config.yml # ClickHouse migrations java -jar target\opik-backend-*.jar dbAnalytics migrate config.yml # Start the backend java -jar target\opik-backend-*.jar server config.yml ``` -------------------------------- ### Set up documentation website locally Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/contributing/documentation.mdx Commands to install dependencies and start the development server for the Fern-based documentation website. ```bash cd apps/opik-documentation/documentation # Install dependencies - Only needs to be run once npm install # Optional - Install Python dependencies if updating Jupyter Cookbooks pip install -r requirements.txt # Run the documentation website locally npm run dev ``` -------------------------------- ### Manual Infrastructure Setup Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/contributing/backend.mdx Commands to start required infrastructure services like Clickhouse, MySQL, and Redis. ```bash ./opik.sh --infra --port-mapping ``` ```powershell .\opik.ps1 --infra --port-mapping ``` -------------------------------- ### Set up Python SDK reference documentation locally Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/contributing/documentation.mdx Commands to install dependencies and start the development server for the Sphinx-based Python SDK reference documentation. ```bash cd apps/opik-documentation/python-sdk-docs # Install dependencies - Only needs to be run once pip install -r requirements.txt # Run the python sdk reference documentation locally make dev ``` -------------------------------- ### Install Frontend Dependencies (Windows Manual Setup) Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/contributing/frontend.mdx Change directory to the frontend application and execute this command to install the required Node.js packages. ```powershell cd apps\opik-frontend npm install ``` -------------------------------- ### Quick Start with Docker Compose Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs-v2/integrations/n8n.mdx Clone the observability repository and run the example workflow using Docker Compose. ```bash # Clone and navigate to the example git clone https://github.com/comet-ml/n8n-observability.git cd n8n-observability/examples/docker-compose # Set your Opik API key (get one free at https://www.comet.com/signup) export OPIK_API_KEY=your_api_key_here # Build and run docker-compose up --build ``` -------------------------------- ### Basic run_simulation Usage Example Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/python-sdk-docs/source/simulation/run_simulation.md Demonstrates the basic setup for running a simulation using run_simulation, including creating a SimulatedUser instance. ```python from opik.simulation import SimulatedUser, run_simulation from opik import track # Create a simulated user user_simulator = SimulatedUser( persona="You are a customer who wants help with a product", model="openai/gpt-5-nano" ) ``` -------------------------------- ### Start Backend Services for Manual Setup (Linux/Mac) Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/contributing/frontend.mdx This command starts the backend services with port mapping enabled, which is necessary for local frontend development. Ensure the backend is running by checking the /is-alive/ping endpoint. ```bash ./opik.sh --backend --port-mapping ``` -------------------------------- ### Setup Example Model Evaluation with Opik Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/docs/cookbook/gretel_opik_integration_cookbook.ipynb Sets up a basic Q&A model evaluation using Opik. This snippet defines a placeholder model and provides instructions for running the actual evaluation. ```python # Example: Simple Q&A model evaluation @opik.track def simple_qa_model(input_data): """A simple example model that generates responses to questions""" question = input_data.get('question', '') # This is just an example - replace with your actual model if 'neural network' in question.lower(): return "A neural network is a computational model inspired by biological neural networks." elif 'machine learning' in question.lower(): return "Machine learning is a subset of AI that enables systems to learn from data." else: return "This is a complex AI/ML topic that requires detailed explanation." print("๐Ÿงช Example model evaluation setup:") print(f"Dataset: {dataset_name}") print("Model: simple_qa_model (replace with your actual model)") print("\n๐Ÿ’ก To run evaluation, uncomment and run the following code:") print("\n๐ŸŽ‰ Integration complete! Your Gretel-generated dataset is ready for model evaluation in Opik.") ``` -------------------------------- ### Install Opik and Harbor Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/tracing/integrations/harbor.mdx Install the necessary libraries for Opik and Harbor. Ensure you have Python installed. ```bash pip install opik harbor ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/contributing/agent-optimizer-sdk.mdx Navigate to the optimizer directory and install the required dependencies, then install the optimizer package in editable mode. ```bash cd sdks/opik_optimizer pip install -r requirements.txt pip install -e . ``` -------------------------------- ### Get Projects (Opik Cloud) Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/reference/rest-api/overview.mdx This example demonstrates how to retrieve projects using the Opik REST API with Opik Cloud or a Comet platform on-premise installation. It requires specific headers for authentication. ```APIDOC ## GET /api/v1/private/projects ### Description Retrieves a list of projects available in Opik Cloud or a Comet platform on-premise installation. Requires authentication headers. ### Method GET ### Endpoint `https://www.comet.com/opik/api/v1/private/projects` ### Parameters #### Request Headers - **Accept**: `application/json` - **Comet-Workspace** (string) - Required - Your workspace name. - **authorization** (string) - Required - Your API key. Note: Does not include the `Bearer ` prefix. ### Request Example ```bash curl -X GET 'https://www.comet.com/opik/api/v1/private/projects' \ -H 'Accept: application/json' \ -H 'Comet-Workspace: ' \ -H 'authorization: ' ``` ### Response #### Success Response (200) - **projects** (array) - A list of project objects. ``` -------------------------------- ### OQL Filter Example: Start Time Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs-v2/observability/export_data.mdx Example of filtering traces by start time using OQL in the Python SDK. DateTime fields require ISO 8601 format. ```python client.search_traces(filter_string='start_time >= "2024-01-01T00:00:00Z"') ``` -------------------------------- ### Install Guardrails Politeness Check Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/tracing/integrations/guardrails-ai.mdx Install the politeness check from the Guardrails Hub. This is an example of a custom check that can be integrated. ```bash guardrails hub install hub://guardrails/politeness_check ``` -------------------------------- ### Get Projects (Open-Source) Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/reference/rest-api/overview.mdx This example shows how to retrieve projects using the Opik REST API with the Open-Source platform. It uses a simple GET request to the specified endpoint. ```APIDOC ## GET /api/v1/private/projects ### Description Retrieves a list of projects available in the Open-Source platform. ### Method GET ### Endpoint `http://localhost:5173/api/v1/private/projects` ### Request Example ```bash curl -X GET 'http://localhost:5173/api/v1/private/projects' ``` ### Response #### Success Response (200) - **projects** (array) - A list of project objects. ``` -------------------------------- ### Set up Python Virtual Environment and Install SDK (Windows) Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs-v2/contributing/guides/python-sdk.mdx Create and activate a Python virtual environment, then install the SDK in editable mode. Configure the SDK to use your local Opik instance. ```powershell # Create a virtual environment py -m venv my-opik-env # Activate it (example path) cd my-opik-env\Scripts && .\activate.bat # Install the SDK in editable mode (adjust path to sdks/python from your current location) pip install -e ../../sdks/python # Configure the SDK to use your local Opik instance opik configure --use_local ``` -------------------------------- ### Start Opik in Docker Mode (Build) Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/contributing/local-development.mdx Build and start all Opik services using Docker Compose. Recommended for initial setup or when code changes require a full rebuild. ```bash # Build and start all services (recommended for first time) ./opik.sh --build # Start without rebuilding (if no code changes) ./opik.sh # Enable port mapping (useful for debugging) ./opik.sh --build --port-mapping # Enable debug logging ./opik.sh --build --debug ``` -------------------------------- ### Download example data Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/tracing/integrations/llama_index.mdx Create a local directory and prepare for data ingestion. ```python import os import requests # Create directory if it doesn't exist os.makedirs('./data/paul_graham/', exist_ok=True) ``` -------------------------------- ### Serve Python SDK documentation Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/AGENTS.md Starts a local server to preview the Python SDK documentation at http://127.0.0.1:8000. ```bash cd python-sdk-docs && make dev ``` -------------------------------- ### Start Local Opik Instance (Linux/Mac) Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/contributing/python-sdk.mdx Run the Opik local development server and configure the Python SDK to use this local deployment. Ensure you are in the root of the repository. ```bash # From the root of the repository ./opik.sh --port-mapping # Configure the Python SDK to point to the local Opik deployment opik configure --use_local ``` -------------------------------- ### Set up Python Virtual Environment and Install SDK (Windows) Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/contributing/python-sdk.mdx Create and activate a Python virtual environment, then install the Opik SDK in editable mode and configure it for local use. Ensure the Python Scripts directory is in your PATH. ```powershell # Create a virtual environment py -m venv my-opik-env # Activate it (example path) cd my-opik-env\Scripts && .\activate.bat # Install the SDK in editable mode (adjust path to sdks/python from your current location) pip install -e ../../sdks/python # Configure the SDK to use your local Opik instance opik configure --use_local ``` -------------------------------- ### Start Python RQ Worker Source: https://github.com/comet-ml/opik/blob/main/apps/opik-backend/docs/JAVA_PYTHON_RQ_INTEGRATION.md Commands to install dependencies, set environment variables, and launch the Python worker. ```bash cd apps/opik-python-backend # Install dependencies pip install -r requirements.txt # Set environment variables export REDIS_HOST=localhost export REDIS_PORT=6379 export REDIS_DB=0 # Start worker python src/opik_backend/rq_worker.py ``` -------------------------------- ### Install and Configure Opik Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/tracing/integrations/deepseek.mdx Install the Opik package and initialize the configuration. ```bash pip install --upgrade --quiet opik opik configure ``` -------------------------------- ### Start Backend Services for Manual Setup (Windows) Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/contributing/frontend.mdx This PowerShell command starts the backend services with port mapping enabled, necessary for local frontend development. Verify the backend is operational via the http://localhost:8080/is-alive/ping endpoint. ```powershell .\opik.ps1 --backend --port-mapping ``` -------------------------------- ### Start Opik locally Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/self-host/overview.mdx Commands to clone the repository and launch the Opik platform locally. ```bash # Clone the Opik repository git clone https://github.com/comet-ml/opik.git # Navigate to the opik folder cd opik # Start the Opik platform ./opik.sh ``` ```powershell # Clone the Opik repository git clone https://github.com/comet-ml/opik.git # Navigate to the opik folder cd opik # Start the Opik platform powershell -ExecutionPolicy ByPass -c ".\opik.ps1" ``` -------------------------------- ### Clone Opik Spring AI Demo Repository Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/tracing/integrations/spring-ai.mdx Clone the repository to get started with the Opik Spring AI integration. Navigate into the cloned directory. ```bash git clone git@github.com:comet-ml/opik-springai-demo.git cd opik-springai-demo ``` -------------------------------- ### Install Opik and Boto3 Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/tracing/integrations/bedrock.mdx Install the necessary packages to enable Bedrock tracking. ```bash pip install opik boto3 ``` -------------------------------- ### Track CrewAI Activities with Opik Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/python-sdk-docs/source/integrations/crewai/index.md Invoke `track_crewai` to start logging your CrewAI activities and LLM calls to the Opik platform. Ensure Opik is installed and configured. ```python from opik.integrations.crewai import track_crewai from crewai import Agent, Crew, Task, Process class YourCrewName: def agent_one(self) -> Agent: return Agent( role="Data Analyst", goal="Analyze data trends in the market", backstory="An experienced data analyst with a background in economics", verbose=True, ) def agent_two(self) -> Agent: return Agent( role="Market Researcher", goal="Gather information on market dynamics", backstory="A diligent researcher with a keen eye for detail", verbose=True ) def task_one(self) -> Task: return Task( name="Collect Data Task", description="Collect recent market data and identify trends.", expected_output="A report summarizing key trends in the market.", agent=self.agent_one() ) def task_two(self) -> Task: return Task( name="Market Research Task", description="Research factors affecting market dynamics.", expected_output="An analysis of factors influencing the market.", agent=self.agent_two() ) def crew(self) -> Crew: return Crew( agents=[self.agent_one(), self.agent_two()], tasks=[self.task_one(), self.task_two()], process=Process.sequential, verbose=True ) track_crewai(project_name="crewai-integration-demo") my_crew = YourCrewName().crew() result = my_crew.kickoff() print(result) ``` -------------------------------- ### Run SWE-bench Evaluation with Opik Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/tracing/integrations/harbor.mdx A complete example demonstrating how to configure Opik and run a SWE-bench evaluation with tracking enabled. This includes setting the project name and specifying the benchmark, agent, and model. ```bash # Configure Opik opik configure # Set project name export OPIK_PROJECT_NAME=swebench-claude-sonnet # Run SWE-bench evaluation with tracking opik harbor run \ -d swebench-lite@head \ -a claude-code \ -m claude-3-5-sonnet-20241022 ``` -------------------------------- ### Import Libraries and Setup Environment Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/docs/cookbook/dynamic_tracing_cookbook.ipynb Imports necessary libraries for Opik and sets up the environment. Displays the Opik version and initial tracing state. ```python import time import random from typing import Dict, Any, List from contextlib import contextmanager import opik ``` ```python print(f"Opik version: {opik.__version__}") print(f"Initial tracing state: {opik.is_tracing_active()}") # the opposite of the track_disable ``` -------------------------------- ### Initialize Opik Client and Get System Usage Metrics Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/python-sdk-docs/source/rest_api/clients/system_usage.md Demonstrates how to initialize the Opik client and retrieve general system usage metrics. Ensure the Opik library is installed and configured. ```python import opik client = opik.Opik() # Get system usage metrics usage = client.rest_client.system_usage.get_system_usage() # Get workspace usage summary workspace_usage = client.rest_client.system_usage.get_workspace_usage_summary() ``` -------------------------------- ### TypeScript: Full Opik Workflow Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs-v2/evaluation/advanced/log_experiments_with_rest_api.mdx Use this TypeScript example to configure Opik, create or get a dataset, insert items, retrieve them, and log experiment results with predictions and feedback scores. ```typescript import { Opik } from "opik"; // Configure Opik const client = new Opik({ apiKey: "your-api-key", apiUrl: "https://www.comet.com/opik/api", projectName: "your-project-name", workspaceName: "your-workspace-name", }); // Step 1: Create dataset const dataset = await client.getOrCreateDataset("geography-questions"); const localDatasetItems = [ { user_question: "What is the capital of France?", expected_output: "Paris" }, { user_question: "What is the capital of Japan?", expected_output: "Tokyo" } ]; await dataset.insert(localDatasetItems); // Step 2: Get dataset items and prepare evaluation results const datasetItems = await dataset.getItems(); // Helper function to get dataset item ID const getDatasetItem = (country: string) => { return datasetItems.find(item => item.user_question.toLowerCase().includes(country.toLowerCase()) ); }; // Prepare evaluation results const evaluationItems = [ { dataset_item_id: getDatasetItem("France")?.id, evaluate_task_result: { prediction: "The capital of France is Paris." }, feedback_scores: [{ name: "accuracy", value: 1.0 }] }, { dataset_item_id: getDatasetItem("Japan")?.id, evaluate_task_result: { prediction: "Japan's capital is Tokyo." }, feedback_scores: [{ name: "accuracy", value: 1.0 }] } ]; // Step 3: Log experiment results const experimentName = `geography-bot-${Math.random().toString(36).substr(2, 4)}`; await client.api.experiments.experimentItemsBulk({ experimentName, datasetName: "geography-questions", items: evaluationItems.map(item => ({ datasetItemId: item.dataset_item_id, evaluateTaskResult: item.evaluate_task_result, feedbackScores: item.feedback_scores.map(score => ({ ...score, source: "sdk" })) })) }); console.log(`Experiment '${experimentName}' created successfully!`); ``` -------------------------------- ### Start LiteLLM Proxy Server Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/tracing/integrations/litellm.mdx Launch the proxy server using the specified configuration file. ```bash litellm --config config.yaml ``` -------------------------------- ### Set up Mastra Agent for Self-hosted Instance Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/tracing/integrations/mastra.mdx Configure the Mastra agent for a self-hosted instance. This example shows the agent setup but omits observability configuration, which would be specific to the self-hosted environment. ```typescript import { Mastra } from "@mastra/core/mastra"; import { Observability } from "@mastra/observability"; import { OtelExporter } from "@mastra/otel"; import { PinoLogger } from "@mastra/loggers"; import { LibSQLStore } from "@mastra/libsql"; import { Agent } from "@mastra/core/agent"; import { openai } from "@ai-sdk/openai"; const OPIK_PROJECT_NAME = process.env.OPIK_PROJECT_NAME!; export const chefAgent = new Agent({ name: "chef-agent", instructions: "You are Michel, a practical and experienced home chef " + "You help people cook with whatever ingredients they have available.", ``` -------------------------------- ### Start LiteLLM Proxy Server Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/tracing/integrations/novita-ai.mdx Launch the proxy server using the specified configuration file. ```bash litellm --config litellm_config.yaml ``` -------------------------------- ### Node.js Tracing Setup with OpikExporter Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/tracing/integrations/vercel-ai-sdk.mdx Configure and start the OpenTelemetry Node.js SDK with `OpikExporter` and automatic instrumentations. Ensure `sdk.start()` is called before your application logic and `sdk.shutdown()` is called to flush traces. ```typescript import { openai } from "@ai-sdk/openai"; import { generateText } from "ai"; import { NodeSDK } from "@opentelemetry/sdk-node"; import { getNodeAutoInstrumentations } from "@opentelemetry/auto-instrumentations-node"; import { OpikExporter } from "opik-vercel"; const sdk = new NodeSDK({ traceExporter: new OpikExporter(), instrumentations: [getNodeAutoInstrumentations()], }); sdk.start(); async function main() { const result = await generateText({ model: openai("gpt-4o"), maxTokens: 50, prompt: "What is love?", experimental_telemetry: OpikExporter.getSettings({ name: "opik-nodejs-example", }), }); console.log(result.text); await sdk.shutdown(); // Flushes the trace to Opik } main().catch(console.error); ``` -------------------------------- ### Start Frontend Development Server Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs-v2/contributing/guides/frontend.mdx Launch the frontend development server manually. ```bash npm run start ``` ```powershell npm run start ``` -------------------------------- ### Basic Multi-Turn Simulation Setup Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/python-sdk-docs/source/simulation/index.md Demonstrates how to set up and run a basic multi-turn conversation simulation using SimulatedUser and run_simulation. Requires importing necessary components from opik.simulation and opik.track. ```python from opik.simulation import SimulatedUser, run_simulation from opik import track # Create a simulated user user_simulator = SimulatedUser( persona="You are a frustrated customer who wants a refund", model="openai/gpt-5-nano" ) # Define your agent @track def my_agent(user_message: str, *, thread_id: str, **kwargs): # Your agent logic here return {"role": "assistant", "content": "I can help you with that..."} # Run the simulation simulation = run_simulation( app=my_agent, user_simulator=user_simulator, max_turns=5 ) print(f"Thread ID: {simulation['thread_id']}") print(f"Conversation: {simulation['conversation_history']}") ``` -------------------------------- ### Build Opik Platform from Source Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/self-host/local_deployment.mdx Clone the Opik repository, navigate to the directory, and use the provided script to build the Frontend and Backend Docker images and start the platform. ```bash # Clone the Opik repository git clone https://github.com/comet-ml/opik.git # Navigate to the opik directory cd opik # Build the Opik platform from source ./opik.sh --build ``` -------------------------------- ### TypeScript Jinja2 Chat Prompt Example Source: https://github.com/comet-ml/opik/blob/main/apps/opik-documentation/documentation/fern/docs/prompt_engineering/prompt_management.mdx Implement Jinja2 templating in TypeScript for conditional prompts. Ensure 'opik' is installed. This allows for dynamic prompt content based on user status or other variables. ```typescript import { ChatPrompt, PromptType } from "opik"; const messages = [ { role: "user", content: ` {% if is_premium %} Hello {{ name }}, welcome to our premium service! {% else %} Hello {{ name }}, welcome! {% endif %} `, }, ]; const chatPrompt = new ChatPrompt({ name: "jinja-example", messages: messages, type: PromptType.JINJA2, projectName: "my-project", }); // With premium user const formatted1 = chatPrompt.format({ name: "Alice", is_premium: true, }); // Result includes: "Hello Alice, welcome to our premium service!" // With regular user const formatted2 = chatPrompt.format({ name: "Bob", is_premium: false, }); // Result includes: "Hello Bob, welcome!" ```