maik97 / LanguageLighthouse

Language Lighthouse is a library for the OpenAI chat completion API using state-of-the-art language models like GPT, with support for asynchronous calls.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LanguageLighthouse

Language Lighthouse is a library for the OpenAI chat completion API using state-of-the-art language models like GPT, with support for asynchronous calls.

Example

from openai_api.async_gpt import AsyncChatGPT

gpt = AsyncChatGPT()

payloads = []
for text in texts:
    payloads.append(gpt.make_payload(
        prompt="Either this or prompt file."
        prompt_file=os.path.join(PROMPTS_DIR, 'prompt.txt'),
        prompt_kwargs=dict(
            input_text=text,
        )
    ))

responses= gpt.get_responses(
    payloads=payloads,
)

About

Language Lighthouse is a library for the OpenAI chat completion API using state-of-the-art language models like GPT, with support for asynchronous calls.


Languages

Language:Python 100.0%