一个简单的HTTP客户端库,用于与结构化输出API交互
Project description
llm_structured_output_Detect_repairs
A simple HTTP client library for interacting with a structured output API.
安装
pip install llm_structured_output_Detect_repairs
以下是一个完整的示例代码,展示了如何使用 llm_structured_output_Detect_repairs 发送请求并解析响应:
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from llm_structured_output_Detect_repairs.llm_output_parser import LLMOutputParser
import json
# 创建 LLMOutputParser 实例
client = LLMOutputParser()
model = 'openai'
output_format = [
{"name": "name", "description": "name of people", "type": "str"},
{"name": "age", "description": "age of person", "type": "int"},
{"name": "stories", "description": "all stories in the life, list of story details", "type": "list"}
]
content = "李白简介"
response_data = client.parse(model, content, output_format)
if response_data:
print("服务端返回数据:")
print(json.dumps(response_data, indent=4, ensure_ascii=False))
else:
print("请求失败或解析错误")
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
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
File details
Details for the file llm_structured_output_detect_repairs-0.1.4.tar.gz.
File metadata
- Download URL: llm_structured_output_detect_repairs-0.1.4.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94d57d1f35d24f3a97fac3e4419a3b9d10cda48bdd2fd6fd0ab380e16b8b58db
|
|
| MD5 |
37556672f7595f745d77edaf3da636b2
|
|
| BLAKE2b-256 |
869b122e77370c2c88582eebbfe5b28402d80fb5345e0914dfc9dbee504e638a
|
File details
Details for the file llm_structured_output_Detect_repairs-0.1.4-py3-none-any.whl.
File metadata
- Download URL: llm_structured_output_Detect_repairs-0.1.4-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe33379c6c700ab909fe933c35df3a9e786569cc928f65e7577e49c95ab7854d
|
|
| MD5 |
ad5b262412a1d77cf39bb1c14c268dd6
|
|
| BLAKE2b-256 |
cf85b0b994dd63cdffa059bec34b846e81fba6ae163b466bd61be05cd3f9ef19
|