Skip to content

yandex-cloud/yandex-cloud-ml-sdk

Repository files navigation

Yandex Cloud ML SDK

This Python library provides a simple and efficient SDK for interacting with Yandex Cloud Machine Learning services. It abstracts the complexities of the raw GRPC calls, allowing developers to integrate cloud functionalities seamlessly into their applications.

Features

  • Easy-to-use interface for accessing the Yandex Cloud ML services
  • Automatic handling of authentication
  • Error handling and data validation for robust integration
  • Support for asynchronous operations

Installation

You can install the library via pip:

pip install yandex-cloud-ml-sdk

Usage

Here's a basic example of how to use the SDK:

from yandex_cloud_ml_sdk import YCloudML

sdk = YCloudML(folder_id="...", auth="<APIKey/IAMToken/SomethingElse>")

model = sdk.models.completions('yandexgpt')
model = model.configure(temperature=0.5)
result = model.run("foo")

for alternative in result:
    print(alternative)

For more usage examples look into examples folder.

Langchain integration

from yandex_cloud_ml_sdk import YCloudML
from langchain_core.messages import AIMessage, HumanMessage

sdk = YCloudML(folder_id="...", auth="<APIKey/IAMToken/SomethingElse>")

model = sdk.models.completions('yandexgpt').langchain()

langchain_result = model.invoke([
    HumanMessage(content="hello!"),
    AIMessage(content="Hi there human!"),
    HumanMessage(content="Meow!"),
])

For more langchain integration examples look into examples/langchain folder.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages