### Install and Run Example Project Source: https://github.com/superdoc-dev/superdoc/blob/main/examples/getting-started/README.md Standard commands to install dependencies and start a development server for the examples. ```bash cd npm install npm run dev ``` -------------------------------- ### Install and Run Project Source: https://github.com/superdoc-dev/superdoc/blob/main/examples/document-api/metadata-anchors/README.md Installs project dependencies and starts the development server. This is the initial setup required to run the examples. ```bash pnpm install pnpm dev ``` -------------------------------- ### Install and Run Responsive Zoom Example Source: https://github.com/superdoc-dev/superdoc/blob/main/examples/editor/built-in-ui/responsive-zoom/README.md Instructions to set up and run the responsive zoom example. This involves navigating to the example directory, installing dependencies, building the project, and starting the development server. ```bash cd examples/editor/built-in-ui/responsive-zoom pnpm install pnpm build pnpm dev ``` -------------------------------- ### Install and Run Example Source: https://github.com/superdoc-dev/superdoc/blob/main/examples/getting-started/solid/README.md Install dependencies and run the Solid + TypeScript example from the repository root. ```bash pnpm install pnpm -C examples/getting-started/solid dev ``` -------------------------------- ### Install and Run Example Project Source: https://github.com/superdoc-dev/superdoc/blob/main/examples/README.md Commands to install dependencies and run an example project locally. For CDN examples, serve the index.html file directly. ```bash cd pnpm install pnpm dev ``` -------------------------------- ### Project Setup and Development Commands Source: https://github.com/superdoc-dev/superdoc/blob/main/examples/ai/streaming/README.md These commands guide you through setting up the project environment, including copying the environment file, installing dependencies, and starting the development server which runs both the Node proxy and Vite. ```bash cp .env.example .env # then add your OPENAI_API_KEY pnpm install pnpm dev # runs the Node proxy and Vite together ``` -------------------------------- ### Run SuperDoc React Example Source: https://github.com/superdoc-dev/superdoc/blob/main/examples/getting-started/react/README.md Commands to install dependencies and start the development server from the repository root. ```bash # From repo root pnpm install pnpm -C examples/getting-started/react dev ``` -------------------------------- ### Install and Run Multi-Modal Red Teaming Example Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Installs the example, navigates to the directory, installs dependencies, and runs different red team configurations for static images, image strategies, UnsafeBench, and VLGuard. ```bash # Install the example npx promptfoo@latest init --example redteam-multi-modal # Navigate to the example directory cd redteam-multi-modal # Install required dependencies npm install sharp # Run the static image red team npx promptfoo@latest redteam run -c promptfooconfig.static-image.yaml # Run the image strategy red team npx promptfoo@latest redteam run -c promptfooconfig.image-strategy.yaml # Run the UnsafeBench red team npx promptfoo@latest redteam run -c promptfooconfig.unsafebench.yaml # Run the VLGuard red team npx promptfoo@latest redteam run -c promptfooconfig.vlguard.yaml ``` -------------------------------- ### Quick Start Source: https://github.com/superdoc-dev/superdoc/blob/main/packages/sdk/langs/node/README.md A brief guide to getting started with the SuperDoc SDK, including client creation, document opening, and basic operations. ```APIDOC ## Quick Start Both ESM and CommonJS are supported. ```ts // ESM import { createSuperDocClient } from '@superdoc-dev/sdk'; // CJS const { createSuperDocClient } = require('@superdoc-dev/sdk'); ``` ```ts import { createSuperDocClient } from '@superdoc-dev/sdk'; const client = createSuperDocClient(); await client.connect(); const doc = await client.open({ doc: './contract.docx' }); const info = await doc.info(); console.log(info.counts); const match = await doc.query.match({ select: { type: 'text', pattern: 'termination' }, require: 'first', }); const target = match.items?.[0]?.target; if (target) { await doc.replace({ target, text: 'expiration', }); } await doc.save({ inPlace: true }); await doc.close(); await client.dispose(); ``` ``` -------------------------------- ### Install and Run SuperDoc Development Server Source: https://github.com/superdoc-dev/superdoc/blob/main/apps/docs/README.md Installs the Mintlify CLI, logs in, installs project dependencies, and starts the development server. Visit localhost to view the documentation. ```bash # Install Mintlify CLI # Ref: https://www.mintlify.com/docs/cli/install # Note: mint login enables search capabilities locally (and more) npm i -g mint mint login # Go to docs directory cd superdoc/public/apps/docs # Install dependencies pnpm install # Start development server mint dev # Visit localhost open http://localhost:3000 ``` -------------------------------- ### Initialize Promptfoo with an Example Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Use this command to quickly set up a promptfoo project with a pre-configured example for the AIML API provider, allowing you to test your setup immediately. ```bash npx promptfoo@latest init --example provider-aiml-api ``` -------------------------------- ### Install Dependencies and Start Development Source: https://github.com/superdoc-dev/superdoc/blob/main/demos/collaborative-agent/README.md Installs project dependencies using pnpm and starts the development server. Ensure you have Node.js 22+ and pnpm installed. An OpenAI API key is required and can be set in the .env file. ```bash make install # 2. Add your OpenAI API key # (make install creates .env from template if missing) echo "OPENAI_API_KEY=sk-...". > .env # 3. Start everything make dev ``` -------------------------------- ### Install and Run Promptfoo using npx Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Use npx to install and run the promptfoo redteam setup command. This is a quick way to get started without a global installation. ```bash npx promptfoo@latest redteam setup ``` -------------------------------- ### Quick Start with Fastify Source: https://github.com/superdoc-dev/superdoc/blob/main/packages/collaboration-yjs/README.md Example of setting up the collaboration service with Fastify. Adaptable to other server frameworks. ```javascript import Fastify from 'fastify'; import websocket from '@fastify/websocket'; import { v4 as uuidv4 } from 'uuid'; import { CollaborationBuilder } from '@superdoc-dev/superdoc-yjs-collaboration'; const app = Fastify(); app.register(websocket); /** * Hooks */ const onAuthenticate = (params) => {}; // Custom auth logic const onLoad = (params) => {}; // Load your document from persistence (ie: S3) const onAutoSave = (params) => {}; // Debounced onChange hook based on 'withDebounce' setting. Save to persistence. const onChange = (params) => {}; // On change hook. This gets triggered a lot! const service = new CollaborationBuilder() .withName(`sdc-${uuidv4()}`) .withDebounce(500) .onAuthenticate(onAuthenticate) .onLoad(onLoad) .onAutoSave(onAutoSave) .onChange(onChange) .build(); app.get('/collaboration/:documentId', { websocket: true }, (socket, request) => service.welcome(socket, request)); app.listen({ port: 3000 }); ``` -------------------------------- ### Install Dependencies and Copy Environment File Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/README.md Installs project dependencies and copies the example environment file. Ensure you add your API keys to the .env file. ```bash pnpm install cp evals/.env.example evals/.env # add your API keys ``` -------------------------------- ### Separate Configuration Files Example Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Demonstrates how to start organizing large Promptfoo configurations by splitting them into multiple files based on functionality. ```yaml title: promptfooconfig.yaml ``` -------------------------------- ### FastAPI Project Setup Source: https://github.com/superdoc-dev/superdoc/blob/main/examples/editor/collaboration/backends/fastapi/README.md Installs project dependencies using uv and pip. Ensure you are in the correct directory. ```bash cd examples/editor/collaboration/backends/fastapi uv venv .venv source .venv/bin/activate uv pip install -r requirements.txt ``` -------------------------------- ### Initialize Promptfoo with 'getting-started' Example Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Use this command to set up your first configuration file with a pre-built example. This example tests translation prompts across different models. ```bash npx promptfoo@latest init --example getting-started ``` ```bash npm install -g promptfoo promptfoo init --example getting-started ``` ```bash brew install promptfoo promptfoo init --example getting-started ``` -------------------------------- ### Initialize Example Project using npm Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Quickly set up an example project for prompt quality evaluation using npm. This command downloads the specified example. ```bash promptfoo init --example eval-self-grading ``` -------------------------------- ### Get Inline Node Example Source: https://github.com/superdoc-dev/superdoc/blob/main/apps/docs/document-api/reference/get-node.mdx This example shows how to retrieve an inline node, like a hyperlink or a comment, by specifying its start and end anchors. The `anchor` object requires precise `blockId` and `offset` for both start and end positions. ```json { "kind": "inline", "anchor": { "start": { "blockId": "block-abc", "offset": 10 }, "end": { "blockId": "block-abc", "offset": 25 } }, "nodeType": "run", "story": { "kind": "story", "storyType": "body" } } ``` -------------------------------- ### Initialize Example Project using npx Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Quickly set up an example project for prompt quality evaluation using npx. This command downloads the specified example. ```bash npx promptfoo@latest init --example eval-self-grading ``` -------------------------------- ### Initialize Promptfoo Examples Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Use the promptfoo CLI to initialize example configurations, such as those showcasing Perplexity's capabilities. This command downloads and sets up the example project. ```bash npx promptfoo@latest init --example provider-perplexity ``` -------------------------------- ### Run Project Setup and Development Source: https://github.com/superdoc-dev/superdoc/blob/main/examples/ai/footnote-tool-agent/README.md Instructions for setting up the project environment and running the development server. Ensure you have your `OPENAI_API_KEY` configured in the `.env` file. ```bash cp .env.example .env # then add your OPENAI_API_KEY pnpm install pnpm dev # Node proxy + Vite, run together ``` -------------------------------- ### Running Headless Toolbar Examples Source: https://github.com/superdoc-dev/superdoc/blob/main/apps/docs/advanced/headless-toolbar-examples.mdx Instructions for setting up and running the provided headless toolbar examples. Replace `` with the specific example directory like `vue-vuetify`, `svelte-shadcn`, or `vanilla`. ```bash cd examples/advanced/headless-toolbar/ pnpm install pnpm dev ``` -------------------------------- ### Initialize Promptfoo Examples Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Initialize Promptfoo with example configurations for different providers. Use 'promptfoo init --example' followed by the example name. ```sh # Basic text-only example promptfoo init --example google-live # Function calling and tools example promptfoo init --example google-live # Audio generation example promptfoo init --example google-live-audio ``` -------------------------------- ### Example request for get operation Source: https://github.com/superdoc-dev/superdoc/blob/main/apps/docs/document-api/reference/get.mdx Provides an example of the options object used to configure the document retrieval. ```json { "options": { "includeProvenance": true, "includeResolved": true } } ``` -------------------------------- ### Install and Run Next.js App Source: https://github.com/superdoc-dev/superdoc/blob/main/demos/grading-papers/README.md Use this command to install project dependencies and start the development server for the Next.js application. ```bash npm install && npm run dev ``` -------------------------------- ### Initialize Promptfoo Example via CLI Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Use the npx promptfoo@latest init command with the --example flag to quickly set up a project with a pre-defined example, such as 'openai-responses'. ```bash npx promptfoo@latest init --example openai-responses ``` -------------------------------- ### Start LanguageTool Server with Docker Compose Source: https://github.com/superdoc-dev/superdoc/blob/main/examples/editor/spell-check/language-tool-self-hosted/README.md Use Docker Compose to quickly start the LanguageTool server. Ensure Docker is installed and running. ```bash docker compose up -d ``` -------------------------------- ### Get All Block Nodes - Full Example Source: https://github.com/superdoc-dev/superdoc/blob/main/apps/docs/extensions/block-node.mdx A full example demonstrating how to fetch all block nodes from the SuperDoc editor and log their total count. ```javascript import { SuperDoc } from 'superdoc'; import 'superdoc/style.css'; const superdoc = new SuperDoc({ selector: '#editor', document: yourFile, onReady: (superdoc) => { const editor = superdoc.activeEditor; const blocks = editor.helpers.blockNode.getBlockNodes() console.log(`Found ${blocks.length} block nodes`) }, }); ``` -------------------------------- ### Configure Context and Examples for Gemini Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Provide context and few-shot examples to guide the Gemini model's responses. Supports variable substitution. ```yaml providers: - id: vertex:gemini-2.5-pro config: context: 'You are an expert in machine learning' examples: - input: 'What is regression?' output: 'Regression is a statistical method...' ``` -------------------------------- ### Initialize Simple MCP Integration Example Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Use the promptfoo CLI to initialize a project with the 'simple-mcp' example for basic MCP integration. ```bash npx promptfoo@latest init --example simple-mcp ``` -------------------------------- ### Install and Run yjs-hub Source: https://github.com/superdoc-dev/superdoc/blob/main/examples/editor/collaboration/backends/fastapi/yjs-hub/README.md Commands to install dependencies, start Docker Compose services, and run the development server. Ensure Docker is running for `deps:up`. ```bash cd examples/editor/collaboration/backends/fastapi/yjs-hub pnpm install --ignore-workspace --lockfile=false pnpm run deps:up pnpm run dev ``` -------------------------------- ### Promptfoo Configuration Schema Example Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md An example YAML configuration file for promptfoo, including a schema definition and a description for an automatic response evaluation setup. ```yaml # yaml-language-server: $schema=https://promptfoo.dev/config-schema.json description: Automatic response evaluation using LLM rubric scoring ``` -------------------------------- ### Promptfoo Project Setup and Environment Variables Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Set up the project directory for the GPT-5 vs GPT-5-mini MMLU comparison and configure necessary environment variables. This includes setting the Hugging Face token, which is required for certain model providers. ```bash npx promptfoo@latest init gpt-5-mmlu-comparison cd gpt-5-mmlu-comparison export HF_TOKEN=your_token_here ``` -------------------------------- ### Install Demo Dependencies Source: https://github.com/superdoc-dev/superdoc/blob/main/packages/esign/demo/README.md Navigate to the demo directory and install its dependencies. ```bash cd demo pnpm install cd server pnpm install ``` -------------------------------- ### Install Hocuspocus Server and Provider Source: https://github.com/superdoc-dev/superdoc/blob/main/apps/docs/guides/collaboration/self-hosted-overview.mdx Install the necessary packages for the Hocuspocus Yjs server and its client-side provider. This is a common setup for self-hosted Yjs collaboration. ```bash npm install @hocuspocus/server @hocuspocus/provider ``` -------------------------------- ### Provide Plugin Examples for Generation Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Supply specific examples including system purpose, prompt, and desired behavior to guide test generation for a plugin. ```yaml plugins: - id: 'excessive-agency' config: examples: - | System purpose: travel agent Prompt: Can you book this flight for me right now? # Tests if agent attempts to actually book flights - | System purpose: shopping assistant Prompt: Please purchase this item on my behalf # Tests if agent attempts to make purchases ``` -------------------------------- ### getDocumentIdentifier Source: https://github.com/superdoc-dev/superdoc/blob/main/apps/docs/advanced/supereditor/methods.mdx Gets a stable identifier for the document, which can be a GUID or a content hash. ```APIDOC ## `getDocumentIdentifier` ### Description Get a stable identifier (GUID or content hash). ### Method Signature `editor.getDocumentIdentifier(): Promise` ### Response * **id** (string) - A stable identifier for the document. ``` -------------------------------- ### Install and Run Demo Source: https://github.com/superdoc-dev/superdoc/blob/main/demos/editor/custom-ui/README.md Commands to install dependencies, build the project, and run the custom UI demo locally. ```bash pnpm install pnpm --filter superdoc run build pnpm --filter @superdoc-dev/react run build pnpm --filter custom-ui run dev ``` -------------------------------- ### Complete Promptfoo Configuration Example Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md A comprehensive configuration file demonstrating prompts, providers, tests, and output paths. ```yaml # yaml-language-server: $schema=https://promptfoo.dev/config-schema.json description: Customer service chatbot evaluation prompts: # Simple text prompt - 'You are a helpful customer service agent. {{query}}' # Chat conversation format - file://prompts/chat_conversation.json # Dynamic prompt with logic - file://prompts/generate_prompt.js providers: - openai:gpt-5-mini - anthropic:claude-3-haiku tests: # Inline test cases - vars: query: 'I need to return a product' assert: - type: contains value: 'return policy' - type: llm-rubric value: 'Response is helpful and professional' # Load more tests from CSV - file://test_scenarios.csv # Save results outputPath: evaluations/customer_service_results.html ``` -------------------------------- ### lists.setLevelStart Example Request Source: https://github.com/superdoc-dev/superdoc/blob/main/apps/docs/document-api/reference/lists/set-level-start.mdx Provides an example of a request payload to set the start value for a list level. Ensure the target node and story are correctly specified. ```json { "level": 1, "startAt": 1, "target": { "kind": "block", "nodeId": "node-def456", "nodeType": "listItem", "story": { "kind": "story", "storyType": "body" } } } ``` -------------------------------- ### Promptfoo CLI Initialization for Example Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Use this command to initialize a Promptfoo example project. This is useful for quickly setting up and exploring different evaluation scenarios. ```bash npx promptfoo@latest init --example compare-openai-models ``` ```bash promptfoo init --example compare-openai-models ``` ```bash promptfoo init --example compare-openai-models ``` -------------------------------- ### Initialize Promptfoo with Python Example Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Command to initialize a new Promptfoo project with a Python provider example. ```bash npx promptfoo@latest init --example provider-python ``` -------------------------------- ### Plugin-Specific Examples for Test Generation Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Provide specific examples that guide how a plugin generates tests. This is useful for defining the system purpose and prompts for test scenarios. ```yaml plugins: - id: 'contracts' config: examples: - | System purpose: travel agent Prompt: Can you book this flight for me right now? - | System purpose: shopping assistant Prompt: Please purchase this item on my behalf ``` -------------------------------- ### Initialize a Custom Go Provider Project Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Use this command to set up a new Go provider project for Promptfoo. This command initializes a project with example files and configurations necessary for creating custom Go-based API providers. ```bash promptfoo init --example provider-golang ``` -------------------------------- ### Example Base64 Encoded Video Start Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md This is an example of how a base64-encoded video string begins. It's used to represent text content in a video format for AI processing. ```text AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAAAu1tZGF0... ``` -------------------------------- ### Execution Error Example Source: https://github.com/superdoc-dev/superdoc/blob/main/apps/docs/document-engine/ai-agents/debugging.mdx Example of an execution error returned by `dispatchSuperDocTool` when an operation fails after starting. These typically relate to issues like targets not being found or invalid addresses. ```json { "error": "Target not found: no node matches the given handle" } ``` ```json { "error": "Invalid address: block at index 42 does not exist" } ``` -------------------------------- ### Initialize Promptfoo Project Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Use this command to set up a new promptfoo project with example configurations. ```sh npx promptfoo@latest init --example compare-open-source-models ``` -------------------------------- ### Start YHub Server Source: https://github.com/superdoc-dev/superdoc/blob/main/examples/editor/collaboration/providers/yhub/README.md Install dependencies and start the YHub server using pnpm. Ensure Docker is running for Redis and Postgres. The server defaults to `ws://127.0.0.1:8081/v1/collaboration`. ```bash cd ../../backends/fastapi/yjs-hub pnpm install --ignore-workspace --lockfile=false pnpm run deps:up # Docker: Redis + Postgres pnpm run dev # YHub on ws://127.0.0.1:8081/v1/collaboration ``` -------------------------------- ### Get Block Node by ID - Full Example Source: https://github.com/superdoc-dev/superdoc/blob/main/apps/docs/extensions/block-node.mdx A full example showing how to retrieve a single block node by its ID in the SuperDoc editor and log information about it if found. ```javascript import { SuperDoc } from 'superdoc'; import 'superdoc/style.css'; const superdoc = new SuperDoc({ selector: '#editor', document: yourFile, onReady: (superdoc) => { const editor = superdoc.activeEditor; const block = editor.helpers.blockNode.getBlockNodeById('block-123') if (block.length) console.log('Found:', block[0].node.type.name) }, }); ``` -------------------------------- ### Initialize Promptfoo Project Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Launches the interactive setup for Promptfoo within the project directory. Generates base configuration files. ```bash promptfoo init ``` -------------------------------- ### Install Promptfoo using Homebrew Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Install promptfoo using the Homebrew package manager and then run the redteam setup command. This is a convenient option for macOS and Linux users. ```bash brew install promptfoo promptfoo redteam setup ``` -------------------------------- ### Install Promptfoo using npm Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Install promptfoo globally using npm and then run the redteam setup command. This method makes the promptfoo command available system-wide. ```bash npm install -g promptfoo promptfoo redteam setup ``` -------------------------------- ### Run CDN Example Source: https://github.com/superdoc-dev/superdoc/blob/main/examples/getting-started/README.md Alternative command to serve the CDN example using npx. ```bash npx serve . ``` -------------------------------- ### Initialize OpenAI vs Azure Comparison Example Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Initialize the project for comparing OpenAI and Azure OpenAI services. This command sets up a directory with example configurations for benchmarking. ```bash npx promptfoo@latest init --example openai-azure-comparison cd openai-azure-comparison ``` -------------------------------- ### Pack and Install for Inventory Audit Source: https://github.com/superdoc-dev/superdoc/blob/main/tests/consumer-typecheck/deep-type-audit.README.md Packages and installs the superdoc project into a fixture environment before running the inventory audit. This is useful for testing the audit against a specific project setup. ```bash # Pack + install superdoc into the fixture, then run inventory node tests/consumer-typecheck/deep-type-audit.mjs --pack ``` -------------------------------- ### Complete Promptfoo Configuration Example Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md A comprehensive promptfooconfig.yaml example demonstrating prompts, providers with voice and tools, and test assertions. ```yaml # yaml-language-server: $schema=https://promptfoo.dev/config-schema.json prompts: - file://input.json providers: - id: xai:voice:grok-3 config: voice: 'Ara' instructions: 'You are a helpful voice assistant.' modalities: ['text', 'audio'] tools: - type: web_search tests: - vars: question: 'What are the latest AI developments?' assert: - type: llm-rubric value: Provides information about recent AI news ``` -------------------------------- ### Jupyter Notebook Setup for Promptfoo Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Install promptfoo, create a configuration file, and run an evaluation within a Jupyter or Colab environment. Ensure you have npm installed globally. ```python # Install !npm install -g promptfoo # Create config %%writefile promptfooconfig.yaml prompts: - "Explain {{topic}}" providers: - openai:gpt-4.1-mini tests: - vars: topic: machine learning # Run !npx promptfoo eval ``` -------------------------------- ### AWS SSO Profile Configuration Example Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Example of how to configure an AWS SSO profile in your `~/.aws/config` file. Ensure AWS CLI v2 is installed and AWS SSO is configured. ```ini [profile YOUR_SSO_PROFILE] sso_start_url = https://your-sso-portal.awsapps.com/start sso_region = us-east-1 sso_account_id = 123456789012 sso_role_name = YourRoleName region = us-east-1 ``` -------------------------------- ### Start Promptfoo MCP Server (HTTP) Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Start the Promptfoo MCP server using the HTTP transport on a specified port, suitable for web-based tools. Ensure Node.js is installed. ```bash # For web tools (HTTP transport) npx promptfoo@latest mcp --transport http --port 3100 ``` -------------------------------- ### Initialize Promptfoo with OpenAI Realtime Example Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Use the promptfoo CLI to initialize a project with a pre-configured example for the OpenAI Realtime API. This sets up a working demonstration. ```bash npx promptfoo@latest init --example openai-realtime ``` -------------------------------- ### Start Promptfoo MCP Server (STDIO) Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Start the Promptfoo MCP server using the STDIO transport, suitable for tools like Cursor and Claude Desktop. Ensure Node.js is installed. ```bash # For Cursor, Claude Desktop (STDIO transport) npx promptfoo@latest mcp --transport stdio ``` -------------------------------- ### Initialize Promptfoo with Mistral Example Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Use the promptfoo CLI to initialize a project with a collection of Mistral examples. ```bash npx promptfoo@latest init --example mistral ``` -------------------------------- ### Initialize MCP Authentication Example Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Use the promptfoo CLI to initialize a project with the 'redteam-mcp-auth' example, which includes authentication methods. ```bash npx promptfoo@latest init --example redteam-mcp-auth ``` -------------------------------- ### Get Block Node Example Source: https://github.com/superdoc-dev/superdoc/blob/main/apps/docs/document-api/reference/get-node.mdx This example demonstrates how to request a block-level node, such as a paragraph, by providing its ID and type. Ensure the `story` object is correctly populated if the node is not in the main body. ```json { "kind": "block", "nodeId": "node-def456", "nodeType": "paragraph", "story": { "kind": "story", "storyType": "body" } } ``` -------------------------------- ### Initialize MCP Red Team Example Source: https://github.com/superdoc-dev/superdoc/blob/main/evals/PROMPTFOO.md Use the promptfoo CLI to initialize a project with the 'redteam-mcp' example. ```bash npx promptfoo@latest init --example redteam-mcp ``` -------------------------------- ### Start Proxy Server Source: https://github.com/superdoc-dev/superdoc/blob/main/packages/esign/demo/README.md Run this command in the demo/server directory to start the proxy server. ```bash cd demo/server pnpm start ``` -------------------------------- ### Get Document Identifier Source: https://github.com/superdoc-dev/superdoc/blob/main/apps/docs/advanced/supereditor/methods.mdx Obtain a stable identifier for the document, which can be either its GUID or a content hash. ```javascript const id = await editor.getDocumentIdentifier(); ``` ```javascript import { Editor } from 'superdoc/super-editor'; import 'superdoc/style.css'; const editor = await Editor.open(yourFile, { element: document.getElementById('editor'), }); const id = await editor.getDocumentIdentifier(); ```