yandex_gpt_rest_api 0.2.5 copy "yandex_gpt_rest_api: ^0.2.5" to clipboard
yandex_gpt_rest_api: ^0.2.5 copied to clipboard

Communicating with the Yandex Foundation Models API.

yandex_gpt_rest_api #

Library for communicating with the Yandex Foundation Models API.

UNDER WORK #

Receiving data from the API is now working.

Asynchronous generation and receipt does not work.

The signature of the methods may change.

Getting started #

Create YandexGptApi instance.

final api = YandexGptApiClient(
  token: "your_token",
  catalog: "your_catalog_id", // Not necessary
);

Now you can use the Foundation Models API.

final response = await api.generateText(
  TextGenerationRequest(
    modelUri: GModels.yandexGpt('folder_id'),
    messages: const [
      Message(
        role: Role.system,
        text: "You joke generating app.",
      ),
      Message(
        role: Role.user,
        text: "Generate some funny joke pls",
      ),
    ],
  ),
);
final generatedMessage = response.alternatives.first;
print(generatedMessage.message.text);
3
likes
0
points
74
downloads

Publisher

unverified uploader

Weekly Downloads

Communicating with the Yandex Foundation Models API.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

async, http

More

Packages that depend on yandex_gpt_rest_api