Skip to main content

Client and Tools for LLMs

Project description

llmskit

统一的LLM客户端与工具

Documentation

完整的 API 文档待补充

Installation

pip install llmskit

Api

# 调用embedding
from llmskit import OpenAIEmbeddings, AsyncOpenAIEmbeddings
# 调用LLM
from llmskit import ChatLLM, AsyncChatLLM

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.6.tar.gz (17.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.6-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llmskit-0.0.6.tar.gz
  • Upload date:
  • Size: 17.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.6.tar.gz
Algorithm Hash digest
SHA256 68919b3fb46585389743462b517acaf007e433226b0e2f73b6cd7274c86b5c56
MD5 43a20943972837fe268a0666ee11a213
BLAKE2b-256 8e8305cb94afc3388fd5153102ebaff478bdb92637208734f0b1bd344dcc526c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llmskit-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 20.9 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 6c0ea07c8a054ded71b93ddd43e23b8962fa0978d7d78c4ab2adf31a421f20a5
MD5 b2615ccfb52c6a7832234e78201af7a7
BLAKE2b-256 d2686a0eedb96c2bb4eb43ab7d98799f39a4cd4499362dcf4f6180b52d5f3f57

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