Skip to main content

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


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.9.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

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

llmskit-0.0.9-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file llmskit-0.0.9.tar.gz.

File metadata

  • Download URL: llmskit-0.0.9.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for llmskit-0.0.9.tar.gz
Algorithm Hash digest
SHA256 e016872bafd72b83317954adc70b9b62c63c990f2a7336b8a810458356257fe8
MD5 9d2d145410ae3fdeae889366a90951a3
BLAKE2b-256 33e9a970996dd247b79058a7e75adf8037a29c425ed518ec108cf22afbb9e01a

See more details on using hashes here.

File details

Details for the file llmskit-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: llmskit-0.0.9-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

Hashes for llmskit-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 de3d50da620adf79cdb6177dc763521d532cdfee6b5314c843279d5b61d04ef1
MD5 41ce9eedf027f23956a088f4f456d862
BLAKE2b-256 924bffd330e0a6fde09a9bf98f891174820b5fb00b63ca9222dc2355977938ad

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