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.
You can install the library via pip:
pip install yandex-cloud-ml-sdk
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.
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.