// src/evaluation/providers/agentv-provider.ts
import { createAnthropic } from "@ai-sdk/anthropic";
import { createAzure } from "@ai-sdk/azure";
import { createGoogleGenerativeAI } from "@ai-sdk/google";
import { createOpenAI } from "@ai-sdk/openai";
function parseModelString(model) {
  const colonIndex = model.indexOf(":");
  if (colonIndex === -1) {
    throw new Error(
      `Invalid model string "${model}". Expected format "provider:model" (e.g., "openai:gpt-5-mini")`
    );
  }
  return {
    provider: model.slice(0, colonIndex),
    modelName: model.slice(colonIndex + 1)
  };
}
function createLanguageModel(modelString) {
  const { provider, modelName } = parseModelString(modelString);
  switch (provider) {
    case "openai":
      return createOpenAI()(modelName);
    case "anthropic":
      return createAnthropic()(modelName);
    case "azure":
      return createAzure().chat(modelName);
    case "google":
      return createGoogleGenerativeAI()(modelName);
    default:
      throw new Error(
        `Unsupported AI SDK provider "${provider}" in model string "${modelString}". Supported providers: openai, anthropic, azure, google`
      );
  }
}
var AgentvProvider = class {
  id;
  kind = "agentv";
  targetName;
  model;
  constructor(targetName, config) {
    this.id = `agentv:${targetName}`;
    this.targetName = targetName;
    this.model = createLanguageModel(config.model);
  }
  /**
   * Direct invoke is not supported for the agentv provider.
   * Use asLanguageModel() with generateText() instead.
   */
  async invoke(_request) {
    throw new Error(
      "AgentvProvider does not support direct invoke(). Use asLanguageModel() with generateText() instead."
    );
  }
  /**
   * Returns the resolved AI SDK LanguageModel for use with generateText/generateObject.
   */
  asLanguageModel() {
    return this.model;
  }
};

export {
  AgentvProvider
};
//# sourceMappingURL=chunk-W5YDZWT4.js.map