Metadata-Version: 2.4
Name: iflytek-haystack
Version: 0.1.0
Summary: An integration between iFlytek Spark and Haystack
Project-URL: Documentation, https://github.com/FenjuFu/iflytek-haystack#readme
Project-URL: Issues, https://github.com/FenjuFu/iflytek-haystack/issues
Project-URL: Source, https://github.com/FenjuFu/iflytek-haystack
Author-email: FenjuFu <92919259+FenjuFu@users.noreply.github.com>
License-Expression: Apache-2.0
License-File: LICENSE.txt
Keywords: generator,haystack,iflytek,llm,spark
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.10
Requires-Dist: haystack-ai>=2.22.0
Description-Content-Type: text/markdown

# iflytek-haystack

[![PyPI - Version](https://img.shields.io/pypi/v/iflytek-haystack.svg)](https://pypi.org/project/iflytek-haystack)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/iflytek-haystack.svg)](https://pypi.org/project/iflytek-haystack)

- [Changelog](https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/iflytek/CHANGELOG.md)

---

An integration between [iFlytek Spark](https://www.xfyun.cn/) and [Haystack](https://haystack.deepset.ai/). iFlytek Spark exposes an OpenAI-compatible chat completion API, so `IFlytekChatGenerator` builds on Haystack's `OpenAIChatGenerator`.

## Installation

```console
pip install iflytek-haystack
```

## Usage

Get an API password from the [iFlytek open platform console](https://console.xfyun.cn/) and set it as the `IFLYTEK_API_KEY` environment variable, then pick a model such as `generalv3.5`, `4.0Ultra` or `lite`.

```python
from haystack.dataclasses import ChatMessage
from haystack_integrations.components.generators.iflytek import IFlytekChatGenerator

client = IFlytekChatGenerator(model="4.0Ultra")
response = client.run([ChatMessage.from_user("用一句话介绍你自己")])
print(response)
```

## Contributing

Refer to the general [Contribution Guidelines](https://github.com/deepset-ai/haystack-core-integrations/blob/main/CONTRIBUTING.md).
