diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8376c6c..626c103 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,15 +11,15 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v6 + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 - name: Setup pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 with: version: 10.8.0 - name: Setup Node.js - uses: actions/setup-node@v6 + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 with: node-version: '20' cache: 'pnpm' @@ -34,4 +34,3 @@ jobs: env: PERPLEXITY_API_KEY: test-api-key run: pnpm test - diff --git a/src/tools/perplexity-search.ts b/src/tools/perplexity-search.ts index fb045a7..dca10ca 100644 --- a/src/tools/perplexity-search.ts +++ b/src/tools/perplexity-search.ts @@ -1,5 +1,6 @@ import { tool } from "ai"; import { z } from "zod"; +import packageJson from "../../package.json"; import type { PerplexitySearchConfig, PerplexitySearchResponse } from "../types"; export function perplexitySearch(config: PerplexitySearchConfig = {}) { @@ -77,6 +78,7 @@ export function perplexitySearch(config: PerplexitySearchConfig = {}) { headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${apiKey}`, + 'X-Pplx-Integration': `perplexity-ai-sdk/${packageJson.version}`, }, body: JSON.stringify(requestBody), });