Client and Tools for LLMs
Project description
llmskit
统一的LLM客户端与工具
Documentation
完整的 API 文档待补充
Installation
pip install llmskit
Api
# 调用LLM API
from llmskit import ChatLLM, AsyncChatLLM
# 调用Embedding API
from llmskit import OpenAIEmbeddings, AsyncOpenAIEmbeddings
# 调用 Reranker API
from llmskit.reranker import Reranker, AsyncReranker
Usage
from llmskit.chat import ChatLLM
chat = ChatLLM.from_openai(model="", base_url="")
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "who are you?"}
]
response = chat.complete(messages=messages)
print(response)
# 输出
# LLMChatComplete(content='I am Qwen, a large-scale language model independently developed by the Tongyi Lab under Alibaba Group. I can answer questions, create text such as stories, official documents, emails, scripts, perform logical reasoning, coding, and more. I can also express opinions and play games. I am trained on a vast amount of internet text and have extensive knowledge and strong language understanding capabilities. How can I assist you today?', reasoning_content='', tool_calls=[])
print(response.content)
Todo
使用新版的返回格式
import openai
openai.responses.create()
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
llmskit-0.0.8.tar.gz
(20.1 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
llmskit-0.0.8-py3-none-any.whl
(24.7 kB
view details)
File details
Details for the file llmskit-0.0.8.tar.gz.
File metadata
- Download URL: llmskit-0.0.8.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2032609090d3f6a87bc41b307ee01315a324e187f2835b39bef6dcecb6a4eef
|
|
| MD5 |
7bd1e0b885ec9cd9971d0a054215bfd1
|
|
| BLAKE2b-256 |
a2139b073dd36384b56bd5d0bdcbd83d7a59d0c86d6633a0271115457604f062
|
File details
Details for the file llmskit-0.0.8-py3-none-any.whl.
File metadata
- Download URL: llmskit-0.0.8-py3-none-any.whl
- Upload date:
- Size: 24.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d9df4a777c44b39c55c9a0e77de23df386954f75b2958b19adbc239f0d9e8ee
|
|
| MD5 |
e4f9f2506c108e304be05bb169c9c044
|
|
| BLAKE2b-256 |
c8914b51fda70b5b27bcc904554a00be168f5a51d4929d1fe6470af5c121d1b3
|