Skip to main content

A wrapper of LiteLLM

Project description

Dais-SDK

Dais-SDK is a wrapper of LiteLLM which provides a more intuitive API and AI SDK like DX.

Installation

pip install dais_sdk

Examples

Below is a simple example of just a API call:

import os
from dotenv import load_dotenv
from dais_sdk import LLM, LlmProviders, LlmRequestParams, UserMessage

load_dotenv()

llm = LLM(provider=LlmProviders.OPENAI,
          api_key=os.getenv("API_KEY", ""),
          base_url=os.getenv("BASE_URL", ""))

response = llm.generate_text_sync( # sync API of generate_text
    LlmRequestParams(
        model="deepseek-v3.1",
        messages=[UserMessage(content="Hello.")]))
print(response)

Below is an example that shows the automatically tool call:

import os
from dotenv import load_dotenv
from dais_sdk import LLM, LlmProviders, LlmRequestParams, UserMessage

load_dotenv()

def example_tool():
    """
    This is a test tool that is used to test the tool calling functionality.
    """
    print("The example tool is called.")
    return "Hello World"

llm = LLM(provider=LlmProviders.OPENAI,
          api_key=os.getenv("API_KEY", ""),
          base_url=os.getenv("BASE_URL", ""))

params = LlmRequestParams(
        model="deepseek-v3.1",
        tools=[example_tool],
        execute_tools=True,
        messages=[UserMessage(content="Please call the tool example_tool.")])

print("User: ", "Please call the tool example_tool.")
messages = llm.generate_text_sync(params)
for message in messages:
    match message.role:
        case "assistant":
            print("Assistant: ", message.content)
        case "tool":
            print("Tool: ", message.result)

Development

Create virtual environment

uv venv

Install all dependencies

uv sync --all-groups

Run test

uv run pytest

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

dais_sdk-0.6.6.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

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

dais_sdk-0.6.6-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file dais_sdk-0.6.6.tar.gz.

File metadata

  • Download URL: dais_sdk-0.6.6.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dais_sdk-0.6.6.tar.gz
Algorithm Hash digest
SHA256 2bc2bf62d427663181e1cb6b931367d8bc5d7164fd6a448f6a1571b403943dae
MD5 35ceba257c6fade26ba4aac827abfeeb
BLAKE2b-256 bd26c76c5326ea11dd7ae2aba55e420c0cd4786a627e8966e4c731064de46368

See more details on using hashes here.

Provenance

The following attestation bundles were made for dais_sdk-0.6.6.tar.gz:

Publisher: publish.yml on Dais-Project/Dais-SDK

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dais_sdk-0.6.6-py3-none-any.whl.

File metadata

  • Download URL: dais_sdk-0.6.6-py3-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dais_sdk-0.6.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d0cb02b8e8356de69ecb004f93f92f37c7b6f805c3f3a4998d07d6adb0a0bbe6
MD5 b1de3aa4f503bd54cca2b58a37e6bf99
BLAKE2b-256 25311ede0967d9451cc61e0823ae1f68444e3452532ae07ca1c52970c99c6fbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for dais_sdk-0.6.6-py3-none-any.whl:

Publisher: publish.yml on Dais-Project/Dais-SDK

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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