Skip to main content

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

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

unofficial_ffm_openai-0.1.1.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

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

unofficial_ffm_openai-0.1.1-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file unofficial_ffm_openai-0.1.1.tar.gz.

File metadata

  • Download URL: unofficial_ffm_openai-0.1.1.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.11

File hashes

Hashes for unofficial_ffm_openai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0e66289de65ada955e2843235fbf8b95376573c2aae44abedbdd9517672167e0
MD5 38604b591a2e51cf2b935f9bff6ac4d7
BLAKE2b-256 146d283fbb2ae90ba343f4821e3c16f2fb7cb8b624e0c330449120d7dd17e1ff

See more details on using hashes here.

File details

Details for the file unofficial_ffm_openai-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for unofficial_ffm_openai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cccd674f6011826aefb4cc19210b006b0fdd845c75c6182275f46f4fa3986e24
MD5 9bd9be5727971ee159dcb2d4f17f4270
BLAKE2b-256 98cfb18929fa68375f944645992a20e80b277df3a61c1a3e1b1a6826bc6c730a

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