Skip to content

Shura1oplot/llmchat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLMChat

A simple python library, a wrapper to the well-known LLM APIs (OpenAI, Anthropic, Google AI, Mistral).

import llmchat

# API keys can be imported from the environment as well
api_keys = {
    "openai": "sk-XXX",
    "anthropic": "sk-ant-api03-XXX",
    "mistralai": "XXX",
    "googleai": "XXX"
}

create_chat = chat_factory(api_keys=api_keys,
                           async_=False)
chat = create_chat(model="gpt-4",  # gpt-4, claude-3, gemini-pro, mistral-large
                   system="You are a business analyst.",  # optional
                   temperature=0.1,  # optional
                   log_dir="logs")  # optional
response = chat.send("Hi!")
print(response)
response = chat.send("How are you?")
print(response)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages