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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bc2bf62d427663181e1cb6b931367d8bc5d7164fd6a448f6a1571b403943dae
|
|
| MD5 |
35ceba257c6fade26ba4aac827abfeeb
|
|
| BLAKE2b-256 |
bd26c76c5326ea11dd7ae2aba55e420c0cd4786a627e8966e4c731064de46368
|
Provenance
The following attestation bundles were made for dais_sdk-0.6.6.tar.gz:
Publisher:
publish.yml on Dais-Project/Dais-SDK
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dais_sdk-0.6.6.tar.gz -
Subject digest:
2bc2bf62d427663181e1cb6b931367d8bc5d7164fd6a448f6a1571b403943dae - Sigstore transparency entry: 922856180
- Sigstore integration time:
-
Permalink:
Dais-Project/Dais-SDK@0dc8bcdb0ec6c4e0a3742f99401c9ec5ab17ea36 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Dais-Project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0dc8bcdb0ec6c4e0a3742f99401c9ec5ab17ea36 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0cb02b8e8356de69ecb004f93f92f37c7b6f805c3f3a4998d07d6adb0a0bbe6
|
|
| MD5 |
b1de3aa4f503bd54cca2b58a37e6bf99
|
|
| BLAKE2b-256 |
25311ede0967d9451cc61e0823ae1f68444e3452532ae07ca1c52970c99c6fbc
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dais_sdk-0.6.6-py3-none-any.whl -
Subject digest:
d0cb02b8e8356de69ecb004f93f92f37c7b6f805c3f3a4998d07d6adb0a0bbe6 - Sigstore transparency entry: 922856189
- Sigstore integration time:
-
Permalink:
Dais-Project/Dais-SDK@0dc8bcdb0ec6c4e0a3742f99401c9ec5ab17ea36 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Dais-Project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0dc8bcdb0ec6c4e0a3742f99401c9ec5ab17ea36 -
Trigger Event:
push
-
Statement type: