Python SDK for the Mixgarden API
Project description
Mixgarden Python SDK
pip install mixgarden
- Use
get_models()to get a list of available models and providers. - Use
get_plugins()to get a list of available plugins. - Use
get_conversations()to get a list of available conversations. - Use
get_conversation(id)to get a specific conversation. - Use
chat(model, messages)when you’re building a conversational UI, or want the platform to maintain context for you. - Use
get_mg_completion(model, content)when you need a one-off, stateless generation enhanced by Mixgarden plugins. - Use
get_completion(model, messages)when you need a one-off, stateless generation directly from LLM (Raw LLM Output).
import os
from mixgarden import MixgardenSDK
sdk = MixgardenSDK(api_key=os.getenv("MIXGARDEN_API_KEY"))
# List available models
models = sdk.get_models()
# Stateful chat (conversation is stored server-side)
chat = sdk.chat(
model="openai/gpt-4o-mini",
# Optionally add conversationId to add to an existing conversation
# conversationId: "your-convo-id",
content="Hello mixgarden!",
pluginId="tone-pro",
pluginSettings={
"emotion-type": "neutral",
"emotion-intensity": 6,
"personality-type": "friendly",
},
)
# Other helper calls
plugins = sdk.get_plugins()
conversations = sdk.get_conversations()
conversation = sdk.get_conversation(conversations[0]["id"])
# One-shot completion (Mixgarden Enhanced)
completion = sdk.get_mg_completion(
model="openai/gpt-4o-mini",
content="hello mixgarden!",
maxTokens=100,
temperature=0.7,
pluginId="tone-pro",
pluginSettings={
"emotion-type": "neutral",
"emotion-intensity": 6,
"personality-type": "friendly"
}
)
# One-shot completion (Raw LLM Output)
completion = sdk.get_completion(
model= "openai/gpt-4o-mini",
messages=[{"role": "user", "content": "Hi there!"}],
maxTokens=100,
temperature=0.7,
)
print(chat)
print(completion)
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
mixgarden-0.1.3.tar.gz
(3.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mixgarden-0.1.3.tar.gz.
File metadata
- Download URL: mixgarden-0.1.3.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
261fff3ffe88aad197c7f7f091c03d6701dd9bccce53d37a972bef5a1e6414da
|
|
| MD5 |
7fd2ca0325126f09f8e1790a6e497df6
|
|
| BLAKE2b-256 |
bb2a14dc3a503aaef658cfa97c0660e7c7f11428812b713da59775c13945fdd8
|
File details
Details for the file mixgarden-0.1.3-py3-none-any.whl.
File metadata
- Download URL: mixgarden-0.1.3-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01ae3027044af7aaa666f30f0543fa2dfbd4c94f45b749db8c9f37ba08ecdf78
|
|
| MD5 |
e1e9912b13a110754811cddfcb37def4
|
|
| BLAKE2b-256 |
80a110a57576539438a1eec5a0c87d7512147c6795bd0dc7e5f5b5d5f3521cc5
|