Metadata-Version: 2.1
Name: yandex-cloud-ml-sdk
Version: 0.1.2
Summary: Multimodal SDK for working with Yandex Cloud ML services
Author-email: Vladimir Lipkin <lipkin@yandex-team.ru>
Requires-Python: >=3.8.1
Description-Content-Type: text/markdown
Classifier: Typing :: Typed
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Classifier: Operating System :: POSIX
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Dist: yandexcloud>=0.292.0,!=0.293
Requires-Dist: grpcio>=1.62.0
Requires-Dist: get-annotations
Requires-Dist: httpx>=0.27,<1
Requires-Dist: typing-extensions>=4
Requires-Dist: langchain-core>=0.3 ; extra == "langchain"
Requires-Dist: pre-commit ; extra == "test"
Requires-Dist: tox ; extra == "test"
Project-URL: Documentation, https://yandex.cloud/ru/docs/foundation-models/
Project-URL: Source, https://github.com/yandex-cloud/yandex-cloud-ml-sdk
Project-URL: Tracker, https://github.com/yandex-cloud/yandex-cloud-ml-sdk/issues
Provides-Extra: langchain
Provides-Extra: test

# 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:

```sh
pip install yandex-cloud-ml-sdk
```

## Usage

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

```python
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

To use langchain integration, install `yandex-cloud-ml-sdk` package with a `langchain` extra:

```sh
pip install yandex-cloud-ml-sdk[langchain]
```

Usage example:

```python
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.

