Skip to main content

xhm base 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_base-0.0.1.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

xhm_base-0.0.1-py2.py3-none-any.whl (8.8 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: xhm_base-0.0.1.tar.gz
  • Upload date:
  • Size: 8.8 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_base-0.0.1.tar.gz
Algorithm Hash digest
SHA256 109e4ecc2e25cac95dc441e2143a617333f76252b500910e762653920a7a53d5
MD5 06b52a0f519fb0d4d961524793c8acbc
BLAKE2b-256 8b7d1c473b5be201645791cb16a1ad7a341e19fbe5cd2c92b5685d63156fa51c

See more details on using hashes here.

File details

Details for the file xhm_base-0.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: xhm_base-0.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 2, 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_base-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8d74361db2891fdf692f8a47fe863f7269344a3a083df036b39675591f7c9cb1
MD5 689cdf1151ccc276c7def2bd2a54fbd7
BLAKE2b-256 e353c34cd85b8c0eea6f49fb8464a501e1b41a3ada4f690d59b2389024990712

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