Loading...
Execute prompts programmatically powered by Google Gemini and Groq inference models.
npm install @promptstack/sdkpip install promptstackimport { PromptStack } from '@promptstack/sdk';
const client = new PromptStack({
apiKey: process.env.PROMPTSTACK_API_KEY!,
});
async function main() {
const promptId = 'YOUR_PROMPT_ID';
// Execute prompt using Google Gemini or Groq
const result = await client.prompts.run(promptId, {
variableValues: {
user_request: 'Your template variable value here',
},
});
if (result.success) {
console.log('Output:', result.output);
console.log('Execution Time:', result.executionTimeMs, 'ms');
}
}
main();