Skip to main content

Python Extension Framework For Turing Planet

Project description

turing-planet星球扩展组件

  • 版本v0.0.10

此模块是星球服务的python扩展组件程序,实现langchainllamaIndex的大模型和向量提取接口。 安装本组件后,用户可以按照langchainllamaIndex的api调用星球API服务,完成注入会话,文档问答等功能

主要模块

  • turing_planet.langchain

langchain 模块扩展,集成方式参照langchain-说明文档

  • turing_planet.llama_index

llama_index 模块扩展,集成方式参照llamaIndex-说明文档

环境准备

  • 本机安装python3,要求3.9
  • 部署好星球服务, 版本要求1.2.0_build1026+
pip install turing-planet
# 如果通过清华镜像无法拉取,尝试以下命令
pip install turing-planet --index-url https://pypi.org/simple

快速开始

安装turing-planet类库后,开始编写你的应用

环境变量设置

支持两种环境变量设置

  • .env 文件

在你的项目下创建.env文件,文件内容为环境变量设置,如:

TURING_PLANET_ENDPOINT=127.0.0.1:9980

程序中,加载env文件

from dotenv import load_dotenv

# 加载环境变量
load_dotenv()
  • 系统环境变量

建议通过环境变量的方式设置,星球api服务地址。优先级高于.env 文件

# 星球api服务
export TURING_PLANET_ENDPOINT=127.0.0.1:9980
  • 参数传递

当然,如果不设置环境变量,也可以通过参数传入。例如

sparkChat = ChatSparkAI(endpoint="127.0.0.1:9980", domain="turing-general")

domain说明

公有云
xfyun-generalv3.5: V3.5协议
xfyun-generalv3: V3.0协议
xfyun-generalv2: V2.0协议
xfyun-general: V1.5协议
私有化
turing-general:通用版本
turing-iflycode.ge: 私有化代码大模型
AIUI
aiui-rewrite-v1: 改写
aiui-slot-v1: 抽槽

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

turing-planet-0.1.4.tar.gz (67.5 kB view details)

Uploaded Source

Built Distribution

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

turing_planet-0.1.4-py3-none-any.whl (119.0 kB view details)

Uploaded Python 3

File details

Details for the file turing-planet-0.1.4.tar.gz.

File metadata

  • Download URL: turing-planet-0.1.4.tar.gz
  • Upload date:
  • Size: 67.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.1

File hashes

Hashes for turing-planet-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a2679cd66578eb0b58c6d9a86d9810e6038fd53cc62f8695081884b3e990c558
MD5 26a0fd5476997bea84b16551bb12e7aa
BLAKE2b-256 94d8711061bf046e63f57b45ea647373f3fed4ea055a12a316d9cab721f67e8b

See more details on using hashes here.

File details

Details for the file turing_planet-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: turing_planet-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 119.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.1

File hashes

Hashes for turing_planet-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fe2e2b03799032d663cdd8df61bc33b666602af04c8190f4ca0875b7d4094d3a
MD5 827ac194d1bac2b53516ea48648af71d
BLAKE2b-256 8e2b8d9dc089e7699f592f968addd1a9aae4879f026e5f3c1912f56e333470cd

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