@youdotcom-oss/ai-sdk-plugin 2.1.1 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/main.js +11 -5
  2. package/package.json +2 -2
package/dist/main.js CHANGED
@@ -4318,7 +4318,8 @@ var checkResponseForErrors = (responseData) => {
4318
4318
  var fetchContents = async ({
4319
4319
  contentsQuery: { urls, formats, format, crawl_timeout },
4320
4320
  YDC_API_KEY = process.env.YDC_API_KEY,
4321
- getUserAgent
4321
+ getUserAgent,
4322
+ customHeaders
4322
4323
  }) => {
4323
4324
  if (!YDC_API_KEY) {
4324
4325
  throw new Error("YDC_API_KEY is required for Contents API");
@@ -4334,6 +4335,7 @@ var fetchContents = async ({
4334
4335
  const options = {
4335
4336
  method: "POST",
4336
4337
  headers: new Headers({
4338
+ ...customHeaders,
4337
4339
  "X-API-Key": YDC_API_KEY,
4338
4340
  "Content-Type": "application/json",
4339
4341
  "User-Agent": getUserAgent()
@@ -4392,7 +4394,8 @@ var ResearchResponseSchema = object({
4392
4394
  var callResearch = async ({
4393
4395
  researchQuery,
4394
4396
  YDC_API_KEY = process.env.YDC_API_KEY,
4395
- getUserAgent
4397
+ getUserAgent,
4398
+ customHeaders
4396
4399
  }) => {
4397
4400
  if (!YDC_API_KEY) {
4398
4401
  throw new Error("YDC_API_KEY is required for Research API");
@@ -4400,6 +4403,7 @@ var callResearch = async ({
4400
4403
  const response = await fetch(RESEARCH_API_URL, {
4401
4404
  method: "POST",
4402
4405
  headers: new Headers({
4406
+ ...customHeaders,
4403
4407
  "X-API-Key": YDC_API_KEY,
4404
4408
  "Content-Type": "application/json",
4405
4409
  "User-Agent": getUserAgent()
@@ -4577,7 +4581,8 @@ var ApiErrorResponseSchema = object({
4577
4581
  var fetchSearchResults = async ({
4578
4582
  YDC_API_KEY = process.env.YDC_API_KEY,
4579
4583
  searchQuery,
4580
- getUserAgent
4584
+ getUserAgent,
4585
+ customHeaders
4581
4586
  }) => {
4582
4587
  const url = new URL(SEARCH_API_URL);
4583
4588
  const searchParams = new URLSearchParams;
@@ -4590,6 +4595,7 @@ var fetchSearchResults = async ({
4590
4595
  const options = {
4591
4596
  method: "GET",
4592
4597
  headers: new Headers({
4598
+ ...customHeaders,
4593
4599
  "X-API-Key": YDC_API_KEY || "",
4594
4600
  "User-Agent": getUserAgent()
4595
4601
  })
@@ -4630,7 +4636,7 @@ import { tool } from "ai";
4630
4636
  // package.json
4631
4637
  var package_default = {
4632
4638
  name: "@youdotcom-oss/ai-sdk-plugin",
4633
- version: "2.1.1",
4639
+ version: "2.2.1",
4634
4640
  description: "Vercel AI SDK plugin for You.com web search, AI agents, and content extraction via MCP",
4635
4641
  license: "MIT",
4636
4642
  engines: {
@@ -4692,7 +4698,7 @@ var package_default = {
4692
4698
  },
4693
4699
  types: "./dist/main.d.ts",
4694
4700
  dependencies: {
4695
- "@youdotcom-oss/api": "0.4.1"
4701
+ "@youdotcom-oss/api": "0.5.1"
4696
4702
  },
4697
4703
  peerDependencies: {
4698
4704
  ai: "^6.0.83"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@youdotcom-oss/ai-sdk-plugin",
3
- "version": "2.1.1",
3
+ "version": "2.2.1",
4
4
  "description": "Vercel AI SDK plugin for You.com web search, AI agents, and content extraction via MCP",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -62,7 +62,7 @@
62
62
  },
63
63
  "types": "./dist/main.d.ts",
64
64
  "dependencies": {
65
- "@youdotcom-oss/api": "0.4.1"
65
+ "@youdotcom-oss/api": "0.5.1"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "ai": "^6.0.83"