Skip to main content

VM-X AI Python SDK

Project description

VM-X SDK for Python

Description

VM-X AI SDK client for Python

Installation

pip install vm-x-ai-sdk
poetry add vm-x-ai-sdk

Usage

from vmxai import CompletionRequest, OpenAIRequest, RequestMessage, VMXClient, VMXClientOAuth

client = VMXClient(
    workspace_id="ws-abc123",
    environment_id="env-abv123",
    domain="env-abc123.clnt.vm-x.ai",
    auth=VMXClientOAuth(
        client_id="clientId", client_secret="clientSecret"
    ),
)

result = client.completion(
    CompletionRequest(
        provider="openai",
        resource="my-resource",
        workload="my-workload",
        messages=[RequestMessage(role="user", content="hey")],
        functions=[],
        openai=OpenAIRequest(model="gpt-3.5-turbo"),
    ),
    stream=True,
)

for message in result:
    print(message.message)

Change Log

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vm_x_ai_sdk-0.2.0.tar.gz (7.2 kB view hashes)

Uploaded Source

Built Distribution

vm_x_ai_sdk-0.2.0-py3-none-any.whl (9.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page