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.7.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.7-py3-none-any.whl
(24.8 kB
view details)
File details
Details for the file llmskit-0.0.7.tar.gz.
File metadata
- Download URL: llmskit-0.0.7.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 |
f45b8c4f4a62f2be213b9366d344ba0f8ebce98cdbea2fc731bff303ce635fbd
|
|
| MD5 |
c5947ba00ae401e8fd0020c1835b5958
|
|
| BLAKE2b-256 |
c374314b84e5846741bc041d2bbc5f5aa13c0b080c37e1004aa9b297d9821ed7
|
File details
Details for the file llmskit-0.0.7-py3-none-any.whl.
File metadata
- Download URL: llmskit-0.0.7-py3-none-any.whl
- Upload date:
- Size: 24.8 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 |
b6a68abde1f07597dd6aaa10417e882e6d358ee1ceb0db6a47c4984fb229cc73
|
|
| MD5 |
ea070410f617de3214a4eaa1f342ba5b
|
|
| BLAKE2b-256 |
88c1cc812e4a0d334b2ed4227ca32fbb913a36edec71728cb5b5101bf38c8f87
|