Prompt Chain

Import test cases from SharePoint CSV files

Import AI evaluation test cases from SharePoint CSV files using Azure AD certificate authentication for enterprise test management.

Works with sharepointazure

81
Spark score
out of 100
Updated 19 days ago
Version 0.121.18

Add to Favorites

Why it matters

Enable teams to manage and import AI evaluation test cases directly from Microsoft SharePoint, allowing centralized test case management in familiar enterprise document repositories with certificate-based authentication.

Outcomes

What it gets done

01

Authenticate to SharePoint using Azure AD certificate-based credentials

02

Fetch CSV test case files from SharePoint document libraries

03

Parse CSV rows into structured test cases with inputs and expected outputs

04

Load test cases into promptfoo evaluation framework for AI model testing

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/pfoo-integration-sharepoint | bash

Steps

Steps in the chain

01
Copy environment variables template
02
Fill in SharePoint credentials in .env
03
Ensure CSV file is in SharePoint
04
Update promptfooconfig.yaml with SharePoint URL
05
Install dependencies
06
Scaffold the example
07
Run the evaluation

Overview

Integration Sharepoint

SharePoint integration example for promptfoo When test cases are stored in SharePoint CSV files

What it does

This promptfoo example demonstrates how to import test cases from CSV files stored in Microsoft SharePoint. It uses Azure AD application credentials with certificate-based authentication to connect to SharePoint sites and pull test data directly into promptfoo evaluations.

When to use - and when NOT to

Use this example when your test cases are maintained in SharePoint CSV files and you need to run promptfoo evaluations against them without manual downloads. It's suitable for teams that already manage test data in SharePoint.

Do not use this if you don't have access to Azure AD application registration or cannot obtain certificate-based authentication credentials. Avoid this approach if your test cases are stored in other systems or if you prefer local file management.

Inputs and outputs

You provide Azure AD credentials (client ID, tenant ID, certificate PEM file path), your SharePoint base URL, and a SharePoint URL pointing to a CSV file with test cases. The CSV must follow this format:

language,input,__expected
French,Hello world,icontains: bonjour
German,I'm hungry,llm-rubric: is german
Swahili,Hello world,similar(0.8):hello world

Prerequisites

This example requires an Azure AD Application with certificate-based authentication, a SharePoint site with appropriate permissions, and a certificate PEM file containing both private key and certificate.

Setup

Copy the environment template and configure your credentials:

cp .env.example .env

Then update your promptfooconfig.yaml with your SharePoint URL:

tests: https://yourcompany.sharepoint.com/sites/yoursite/Shared%20Documents/test-cases.csv

Run the example with:

npm install
npx promptfoo@latest init --example integration-sharepoint
npx promptfoo eval
Source README

integration-sharepoint (SharePoint Integration Example)

This example demonstrates how to use promptfoo with Microsoft SharePoint to import test cases from CSV files stored in SharePoint.

Prerequisites

  1. Azure AD Application with certificate-based authentication
  2. SharePoint site with appropriate permissions
  3. Certificate PEM file containing both private key and certificate

Setup

  1. Copy the environment variables template:

    cp .env.example .env
    
  2. Fill in your SharePoint credentials in .env:

    • SHAREPOINT_CLIENT_ID - Your Azure AD application client ID
    • SHAREPOINT_TENANT_ID - Your Azure AD tenant ID
    • SHAREPOINT_CERT_PATH - Path to your certificate PEM file
    • SHAREPOINT_BASE_URL - Your SharePoint base URL
  3. Ensure your CSV file is in SharePoint with the following format:

    language,input,__expected
    French,Hello world,icontains: bonjour
    German,I'm hungry,llm-rubric: is german
    Swahili,Hello world,similar(0.8):hello world
    
  4. Update promptfooconfig.yaml with your SharePoint URL:

    tests: https://yourcompany.sharepoint.com/sites/yoursite/Shared%20Documents/test-cases.csv
    

Running the Example

### Install dependencies
npm install

### Scaffold the example
npx promptfoo@latest init --example integration-sharepoint

### Run the eval
npx promptfoo eval

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.