Skip to main content

xhm python sdk

Project description

BOCHU SDK 使用说明

封装sdk时请多考虑去解决一类问题、而不是一个问题

使用教程

一、pip方式

添加私有源:

export PIP_TRUSTED_HOST="mirrors.aliyun.com nexus.fscut.com"
pip config set global.timeout 60
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip config set global.extra-index-url http://nexus_user:nexus61259023@nexus.fscut.com/repository/pypi-group/simple/
pip config set install.trusted-host nexus.fscut.com
pip config set global.trusted-host nexus.fscut.com

# 查看配置是否生效
pip config list --verbose

dockerfile形式:

FROM soulpal-service:0.3.0

WORKDIR /code
COPY . /code

RUN pip install --upgrade --timeout 60 \
    --index-url https://mirrors.cloud.tencent.com/pypi/simple/ \
    --extra-index-url http://nexus_user:nexus61259023@nexus.fscut.com/repository/pypi-group/simple/ \
    --trusted-host mirrors.cloud.tencent.com \
    --trusted-host nexus.fscut.com \
    -r requirements.txt

ENV OPENAI_API_KEY ''
CMD ["/usr/local/bin/python3","main.py"]

安装:

pip install xhm
or
pip install xhm -i https://nexus_user:nexus61259023@nexus.fscut.com/repository/pypi-group/simple/

安装单个模块:

pip install xhm[xhm_log]

安装所有:

pip install xhm[all]

二、poetry

添加私有源:

poetry config http-basic.trusted-hosts mirrors.aliyun.com nexus.fscut.com
poetry config repositories.my-repo http://nexus_user:nexus61259023@nexus.fscut.com/repository/pypi-group/simple/
poetry config repositories.aliyun https://mirrors.aliyun.com/pypi/simple/

dockerfile形式只需要修改pyproject.toml文件:

xhm = "^0.4.6"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[[tool.poetry.source]]
name = "xhm"
url = "https://nexus_user:nexus61259023@nexus.fscut.com/repository/pypi-group/simple/"

[[tool.poetry.source]]
name = "aliyun"
url = "https://mirrors.aliyun.com/pypi/simple/"

安装:

poetry add xhm@0.1.7 --verbose

在代码中使用BOCHU SDK

from xhm_log import log

def test_case():
    log.error('cc')

开发包上传

# pip install setuptools==58.0.4
 python setup.py sdist upload -r nexus

poetry 开发包

poetry config repositories.nexus http://nexus.fscut.com/repository/fs-pypi/
poetry config http-basic.nexus 用户名 密码

poetry build
poetry publish --repository nexus

# 官方
poetry config pypi-token.pypi pypi-AgEIcHlwaS5vcmcCJGYyM2E5ZjkxLWZhYTYtNGE2Mi1iOGZlLTczOGU2YjVhNzNkNAACKlszLCIwNzE3NWUwYy05YTA5LTQ3ZmMtOTYxNS0xZjExZjQyMmVhMDEiXQAABiCb__bveg49S186PbTgid0-FqFAz5GOxr0sB5dY23NuKg

更新并安装

poetry add xhm==0.5.6

升级记录

版本 日期 更新记录 开发人员
0.5.15 2024-11-27 拆分基础SDK和业务SDK 邹慧刚
0.5.6 2024-11-22 重新调整日志SDK,追加日志写入文件 邹慧刚
0.5.0 2024-11-11 增加xhm_chat_memory SDK 邹慧刚
0.4.9 2024-11-08 增加xhm_util处理url地址 邹慧刚
0.4.2 2024-08-21 更改日志写入文件 邹慧刚
0.3.6 2024-08-01 增加html/markdown转image sdk 邹慧刚
0.3.5 - 提取实体同时获取传统关键词 邹慧刚
0.3.2 - 意图识别增加类型验证 邹慧刚
0.2.9 - 问题提取增加实体对象的提取,没有则不回复 邹慧刚
0.2.8 - 问题转结构化(Question->structure)并在关键词提取时增加意图 邹慧刚
0.2.7 - 修改关键词提取提取不相关词汇问题 邹慧刚
0.2.1 - 修改关键词提取bug 邹慧刚
0.2.0 - 关键词服务支持向量搜索,结巴分词 邹慧刚
0.1.8 - 删除toml 代振兴
0.1.7 - 支持PEP 517标准 邹慧刚
0.1.6 - 固定依赖版本 邹慧刚
0.1.5 - 更新dspy结果集model.json 代振兴
0.1.4 - 分模块加载依赖 邹慧刚
0.1.3 - 增加dspy依赖 代振兴
0.1.2 - 修改关键词sdk,增加dspy 邹慧刚
0.1.1 - csp回答渲染方式支持多种 代振兴
0.1.0 - 小版本封版 代振兴
0.0.6 - 增加关键词提取sdk 代振兴
0.0.5 - 增加config sdk 邹慧刚
0.0.4 - 增加scp sdk 代振兴
0.0.3 - 增加redis sdk 邹慧刚
0.0.2 - 增加mq sdk 邹慧刚
0.0.1 - 增加log sdk 邹慧刚

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

xhm_all-0.0.1.tar.gz (89.0 kB view details)

Uploaded Source

Built Distribution

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

xhm_all-0.0.1-py3-none-any.whl (92.0 kB view details)

Uploaded Python 3

File details

Details for the file xhm_all-0.0.1.tar.gz.

File metadata

  • Download URL: xhm_all-0.0.1.tar.gz
  • Upload date:
  • Size: 89.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.13 Darwin/24.2.0

File hashes

Hashes for xhm_all-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8daa755045c67a9ae083df63cd7fa973a86b782977b3d56c486f50d3753b80d7
MD5 fea6e02e69fc47950719f76d645569d6
BLAKE2b-256 b04674ea4f739b815b831dc35a3eb498a41290fa3e865ee9111e3ba980256843

See more details on using hashes here.

File details

Details for the file xhm_all-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: xhm_all-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 92.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.13 Darwin/24.2.0

File hashes

Hashes for xhm_all-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ac1b2cf0f2032a8b28d1af9b7137d75921f0ee3883b4023a13588d43d751d7b8
MD5 5aa32f4d5ef19b18acf32bae93ce30cd
BLAKE2b-256 3386d3f10b3a3e55c6cb3a8d6b0dc1e1ad96f0744eaba9977156289e4d8e8492

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