Skip to main content

LLM Gateway Service

Project description

初始化配置

store = BaseRowStore( api_host="...", api_key="...", db_code="3", model_table_code="614", prompt_table_code="308", chat_log_table_code="309") llm_gateway = LLMGateway(store)

渲染 Prompt 内容

prompt_code = "test_template" prompt_record, messages = llm_gateway.render_prompt(prompt_code, {"topic": "科幻"})

LLM 对话

chatCompletion, time_cost = llm_gateway.completions(prompt_record, messages) print(chatCompletion,time_cost)

保存会话记录

trace_id = "1234567890" log = llm_gateway.save_log(trace_id,prompt_record) print(log)

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

llm_store-0.1.3.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

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

llm_store-0.1.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file llm_store-0.1.3.tar.gz.

File metadata

  • Download URL: llm_store-0.1.3.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Darwin/23.5.0

File hashes

Hashes for llm_store-0.1.3.tar.gz
Algorithm Hash digest
SHA256 950b9e2be9bcd0f861abf9dc8aef0ddb73a83d7b953f494f68fb5f6f8e279df4
MD5 70a3e4bd953c445f99a8ac59416936e9
BLAKE2b-256 3857b13d794a975f85c2e8596b035f9dbe247f27e6307480152355930ef995bd

See more details on using hashes here.

File details

Details for the file llm_store-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: llm_store-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Darwin/23.5.0

File hashes

Hashes for llm_store-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f1a0f2c70919e1318f19962608a8e7a1617bce32946720e8e088726eeabfc304
MD5 9ef5746177dbaeadadda9d60c0015c9d
BLAKE2b-256 99b95a2dd63570ad165491d461c75a809fc539efdcbc80e3ac60dde896776c39

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