svector-sdk
Version:
Official JavaScript and TypeScript SDK for accessing SVECTOR APIs.
28 lines (27 loc) • 876 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const src_1 = require("../src");
async function basicConversation() {
const client = new src_1.SVECTOR({
apiKey: process.env.SVECTOR_API_KEY,
});
try {
console.log('Creating a basic conversation...\n');
const result = await client.conversations.create({
model: 'spec-3-turbo',
instructions: 'You are a helpful assistant who explains scientific concepts clearly.',
input: 'Why is the sky blue?',
temperature: 0.7,
max_tokens: 150,
});
console.log('AI Response:');
console.log(result.output);
console.log('Request ID:', result._request_id);
}
catch (error) {
console.error('Error:', error);
}
}
if (require.main === module) {
basicConversation();
}