llama-index llms iflytek spark integration
Project description
LlamaIndex Llms Integration: iFlytek Spark
iFlytek Spark exposes an OpenAI-compatible chat-completions API, so this integration builds on OpenAILike.
Installation
pip install llama-index-llms-iflytek
Usage
Get an API password from the iFlytek open platform console and pass it as api_key (or set the IFLYTEK_API_KEY environment variable). Pick a model such as generalv3.5, 4.0Ultra or lite.
from llama_index.llms.iflytek import IFlytek
llm = IFlytek(model="4.0Ultra", api_key="your-api-password")
response = llm.complete("用一句话介绍你自己")
print(response)
Chat and streaming work the same way as any other OpenAILike model:
from llama_index.core.llms import ChatMessage
messages = [ChatMessage(role="user", content="Hello")]
for chunk in llm.stream_chat(messages):
print(chunk.delta, end="")
The default API base is https://spark-api-open.xf-yun.com/v1; override it with the IFLYTEK_API_BASE environment variable or the api_base argument if needed.
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 llama_index_llms_iflytek-0.1.0.tar.gz.
File metadata
- Download URL: llama_index_llms_iflytek-0.1.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba125c1a21d27d5daf6bba1679c8e371aec0b5f8ab107a960ee64a4914c9e66f
|
|
| MD5 |
123ef2884ca91cea4cd01ca46145eff8
|
|
| BLAKE2b-256 |
a4d6105c223947af5f956ee3513c77f2c597444387bd6a2e3a6a5746f4950faf
|
Provenance
The following attestation bundles were made for llama_index_llms_iflytek-0.1.0.tar.gz:
Publisher:
publish.yml on FenjuFu/llama-index-llms-iflytek
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llama_index_llms_iflytek-0.1.0.tar.gz -
Subject digest:
ba125c1a21d27d5daf6bba1679c8e371aec0b5f8ab107a960ee64a4914c9e66f - Sigstore transparency entry: 2167426637
- Sigstore integration time:
-
Permalink:
FenjuFu/llama-index-llms-iflytek@01512cdfde70134e667da931cda8849dc0ef3739 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/FenjuFu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@01512cdfde70134e667da931cda8849dc0ef3739 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file llama_index_llms_iflytek-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_llms_iflytek-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20a5543acd7174c4a4acd9663c9266d89ed0e7a559f3517b03110ff8c52c4d50
|
|
| MD5 |
879610c57fc591c9490abbfc80529a57
|
|
| BLAKE2b-256 |
9835bc0daa5f5388e5b3be4a73bdb54ae01326f31abdfc7fa4c5d7a93aa83c07
|
Provenance
The following attestation bundles were made for llama_index_llms_iflytek-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on FenjuFu/llama-index-llms-iflytek
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llama_index_llms_iflytek-0.1.0-py3-none-any.whl -
Subject digest:
20a5543acd7174c4a4acd9663c9266d89ed0e7a559f3517b03110ff8c52c4d50 - Sigstore transparency entry: 2167426663
- Sigstore integration time:
-
Permalink:
FenjuFu/llama-index-llms-iflytek@01512cdfde70134e667da931cda8849dc0ef3739 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/FenjuFu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@01512cdfde70134e667da931cda8849dc0ef3739 -
Trigger Event:
workflow_dispatch
-
Statement type: