hataraku
Version:
An autonomous coding agent for building AI-powered development tools. The name "Hataraku" (働く) means "to work" in Japanese.
33 lines • 1.4 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createVertexProvider = createVertexProvider;
exports.createVertexModel = createVertexModel;
const google_vertex_1 = require("@ai-sdk/google-vertex");
/**
* Create a Google Vertex AI provider with the given configuration
* @param project Google Cloud project ID (optional, defaults to environment variable)
* @param location Google Cloud location (optional, defaults to 'us-central1')
* @returns Google Vertex AI provider
*/
async function createVertexProvider(project, location = 'us-central1') {
const projectId = project || process.env.GOOGLE_CLOUD_PROJECT;
if (!projectId) {
throw new Error('GOOGLE_CLOUD_PROJECT is not set');
}
return (0, google_vertex_1.createVertex)({
project: projectId,
location
});
}
/**
* Create a Google Vertex AI model with the given model name
* @param model Model name (defaults to gemini-1.5-flash)
* @param project Google Cloud project ID (optional, defaults to environment variable)
* @param location Google Cloud location (optional, defaults to 'us-central1')
* @returns Google Vertex AI model
*/
async function createVertexModel(model = 'gemini-1.5-flash', project, location = 'us-central1') {
const vertex = await createVertexProvider(project, location);
return vertex(model);
}
//# sourceMappingURL=vertex.js.map