An unofficial Formosa Foundation Model API client implementation compatible with LangChain and OpenAI
Project description
unofficial_ffm_openai_client
An unofficial Formosa Foundation Model client implementation based on OpenAI and LangChain
Introduction
This is an unofficial Python client implementation for the Formosa Foundation Model public endpoint, compatible with the OpenAI Python client and LangChain. Currently, it only implements the Conversation API and supports the public endpoint. Note that the synchronous API is not yet implemented.
Usage
Install using pypi:
pip install unofficial-ffm-openai
You can use it similarly to the original OpenAIChat, with a few different parameters:
from ffm.langchain.language_models.ffm import FfmChatOpenAI
chat_ffm = FfmChatOpenAI(
ffm_endpoint="https://api-ams.twcc.ai/api",
max_tokens=1000,
temperature=0.5,
top_k=50,
top_p=1.0,
frequency_penalty=1.0,
ffm_api_key="your key",
ffm_deployment="ffm-mistral-7b-32k-instruct", # or other model name
streaming=True,
callbacks=callbacks
)
Limitation
Currently, it has only been tested with the following dependencies:
langchain 0.1.20
langchain-community 0.0.38
langchain-core 0.1.52
langchain-openai 0.1.7
langchain-text-splitters 0.0.2
langchainhub 0.1.15
and the OpenAI client:
openai 1.30.1
TODO
- Full implementation for the synchronous API.
- Support for function calls.
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
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 unofficial_ffm_openai-0.1.2.tar.gz.
File metadata
- Download URL: unofficial_ffm_openai-0.1.2.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26059726d4b13e6ecc56a6622af6b49f7399ecf2808b80e458189e319d9914c0
|
|
| MD5 |
65bd61b1991616e072ba8b4dcf1d7350
|
|
| BLAKE2b-256 |
7c1a2ba0a63c7e506c73a854366df781e7d38952c96f62d4737ee8db3c06db8e
|
File details
Details for the file unofficial_ffm_openai-0.1.2-py3-none-any.whl.
File metadata
- Download URL: unofficial_ffm_openai-0.1.2-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4791db99490bf377afed0d29c8aeeeb4c42d6dd18c66cc37d69f890fc6b761c9
|
|
| MD5 |
fe21459b92f72a942c4c1a489496b63d
|
|
| BLAKE2b-256 |
20a01f742e0f1725d3d7005b1b55994907d21696778b095cbb5a1d5663c18ef9
|