donobu
Version:
Create browser automations with an LLM agent and replay them as Playwright scripts.
57 lines • 2.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GptConfigInputSchema = exports.GptConfigSchema = exports.VercelAiConfigSchema = exports.OpenAiConfigSchema = exports.OllamaConfigSchema = exports.GoogleGenerativeAiConfigSchema = exports.DonobuGptClientConfigSchema = exports.AnthropicConfigSchema = void 0;
const v4_1 = require("zod/v4");
exports.AnthropicConfigSchema = v4_1.z.object({
type: v4_1.z.literal('ANTHROPIC'),
apiKey: v4_1.z.string(),
modelName: v4_1.z.string(),
});
exports.DonobuGptClientConfigSchema = v4_1.z.object({
type: v4_1.z.literal('DONOBU'),
apiKey: v4_1.z.string(),
});
exports.GoogleGenerativeAiConfigSchema = v4_1.z.object({
type: v4_1.z.literal('GOOGLE_GEMINI'),
apiKey: v4_1.z.string(),
modelName: v4_1.z.string(),
});
exports.OllamaConfigSchema = v4_1.z.object({
type: v4_1.z.literal('OLLAMA'),
modelName: v4_1.z.string(),
apiUrl: v4_1.z.string().optional(),
});
exports.OpenAiConfigSchema = v4_1.z.object({
type: v4_1.z.literal('OPENAI'),
apiKey: v4_1.z.string(),
modelName: v4_1.z.string(),
});
exports.VercelAiConfigSchema = v4_1.z.object({
type: v4_1.z.literal('VERCEL_AI'),
provider: v4_1.z.string(),
modelName: v4_1.z.string(),
});
/**
* A resource structure that can be used to establish connectivity with a
* particular GPT platform and model. If there are an 'apiKey', and/or a
* `secretAccessKey` fields, they will be redacted before being returned
* through the API.
*/
exports.GptConfigSchema = v4_1.z.discriminatedUnion('type', [
exports.AnthropicConfigSchema,
exports.DonobuGptClientConfigSchema,
exports.GoogleGenerativeAiConfigSchema,
exports.OllamaConfigSchema,
exports.OpenAiConfigSchema,
exports.VercelAiConfigSchema,
]);
/**
* Permissive schema for configs that might come from plugins.
* Accepts all built-in types (with full validation) plus any object
* with a string `type` field (for plugin-provided types).
*/
exports.GptConfigInputSchema = v4_1.z.union([
exports.GptConfigSchema,
v4_1.z.looseObject({ type: v4_1.z.string() }),
]);
//# sourceMappingURL=GptConfig.js.map