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, RequestMessage, VMXClient, VMXClientOAuth
client = VMXClient(
domain="env-abc123.clnt.dev.vm-x.ai",
environment_id="env-abc123",
workspace_id="ws-abc123",
# Authentication options
# OAuth Client credentials
auth=VMXClientOAuth(
client_id="abc123",
client_secret="abc123",
),
# Or API Key
api_key="abc123",
)
# Streaming
streaming_response = client.completion(
request=CompletionRequest(
resource="resource1-openai-gpt-3-5-turbo",
workload="high1",
messages=[
RequestMessage(
role="user",
content="Hey there!",
)
],
),
)
for message in streaming_response:
print(message.message)
# Non-Streaming
response = client.completion(
request=CompletionRequest(
resource="resource1-openai-gpt-3-5-turbo",
workload="high1",
messages=[
RequestMessage(
role="user",
content="Hey there!",
)
],
),
stream=False,
)
print(response.message)
Change Log
Project details
Release history Release notifications | RSS feed
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.4.0.tar.gz
(7.7 kB
view hashes)
Built Distribution
Close
Hashes for vm_x_ai_sdk-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 286a16a0a4b329d154f4802379dc9bd2ec7f220edfb70188a2bc7e7f13bdf149 |
|
MD5 | 677a14adae30f8c51a66d918985f7306 |
|
BLAKE2b-256 | ad3a53d3f56e43587bac6c4962632a2974c7109a86f87b6994a65d7a294ba873 |