Skip to main content

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


Download files

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

Source Distribution

oylanapi-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

OylanAPI-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

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

Hashes for oylanapi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b8a565409c9fc898eebd51e4845d5b5eea0dff555bc6b40de58cb388f57baf1a
MD5 bec0202eb1d2274531792d178907cfad
BLAKE2b-256 c5837f39f4984973cf6fe42600eb385224e6dc797d8948df86bc41cffb220976

See more details on using hashes here.

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

Hashes for OylanAPI-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5f36865bf1b0a3c5da7a58f0c92503dbd11f6e64a8c22e3abc878b936911c68
MD5 d52b55c011da22359110d49e85134be4
BLAKE2b-256 36631d81cd568fa4f707a39df4d221b8e9c987ccda99760d2301f28497034e7d

See more details on using hashes here.

Supported by

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