yandex-gpt-node
TypeScript icon, indicating that this package has built-in type declarations

1.0.11 • Public • Published

yandex-gpt Build Status

This library provides convenient access to YandexGPT from Node.js

Getting Started

Install the module with: npm install yandex-gpt-node

Import

from:

import { YandexGPT } from 'yandex-gpt-node';

require:

const YandexGPT = require('yandex-gpt-node').YandexGPT;

Start

Creating an Instance of a Class. quickstart / apiKey

const client = new YandexGPT(apiKey, folderId);
await client.createToken();

Use

const res = await client.generateText({
	modelUri: `gpt://${client.getFolderId()}/yandexgpt-lite`,
	completionOptions: {
		stream: false,
		temperature: 0.6,
		maxTokens: 100,
	},
	messages: [
		{
			role: Role.SYSTEM,
			text: "You are a smart assistant",
		},
		{
			role: Role.USER,
			text,
		},
	],
});

License

Copyright (c) 2024 T0R0NT0T0KY0
Licensed under the MIT license.

Package Sidebar

Install

npm i yandex-gpt-node

Weekly Downloads

2

Version

1.0.11

License

MIT

Unpacked Size

48.1 kB

Total Files

110

Last publish

Collaborators

  • dmitry_the_fucker_lv