A Python client for the Oylan Assistant API
Project description
OylanAPI
OylanAPI is a Python library for interacting with the Oylan Assistant API, available at oylan.nu.edu.kz. Before using this library, you must register on the website and obtain an API key. The resources consumed by the library will be tied to your account.
Features
- Create, list, retrieve, update (PUT/PATCH), or delete assistants.
- Create interactions (sending text prompts, file prompts, images, etc.).
- Upload DOCX files to update an assistant's context.
- Retrieve available models from the Oylan Assistant platform.
Installation
Once the library is published, install it via pip:
pip install OylanAPI
Usage
Here's how to use the library:
from OylanAPI import Client
# Create a client with your API key
client = Client(api_key="your-api-key")
# 1) List all assistants
assistants = client.list_assistants()
print("Assistants:", assistants)
# 2) Create a new assistant
new_assistant = client.create_assistant(
name="My Assistant",
description="Sample description",
temperature=0.7,
max_tokens=512,
model="Oylan",
system_instructions="System instructions here",
context="Base context here"
)
print("Created assistant:", new_assistant)
# 3) Create an interaction
interaction_response = client.create_interaction(
assistant_id=new_assistant["id"],
text_prompt="Hello, can you summarize the contents of this file?"
)
print("Interaction response:", interaction_response)
# 4) Upload a DOCX file
upload_result = client.upload_docx(
assistant_id=new_assistant["id"],
file_paths=["/path/to/document.docx"]
)
print("Upload result:", upload_result)
Note
- You need to register at oylan.nu.edu.kz and generate an API key from the For Developers -> Api Keys tab.
- All resource usage is tied to your account, so use your key responsibly.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
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 oylanapi-0.1.0.tar.gz.
File metadata
- Download URL: oylanapi-0.1.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8a565409c9fc898eebd51e4845d5b5eea0dff555bc6b40de58cb388f57baf1a
|
|
| MD5 |
bec0202eb1d2274531792d178907cfad
|
|
| BLAKE2b-256 |
c5837f39f4984973cf6fe42600eb385224e6dc797d8948df86bc41cffb220976
|
File details
Details for the file OylanAPI-0.1.0-py3-none-any.whl.
File metadata
- Download URL: OylanAPI-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5f36865bf1b0a3c5da7a58f0c92503dbd11f6e64a8c22e3abc878b936911c68
|
|
| MD5 |
d52b55c011da22359110d49e85134be4
|
|
| BLAKE2b-256 |
36631d81cd568fa4f707a39df4d221b8e9c987ccda99760d2301f28497034e7d
|