SamSuka
echohive42
echohive42

patreon


Boilerplate Python functions to make calls to Openai API chatcompletions

general_gpt_call is a  generalized function which takes in arguments for
- model type(gpt-3.5-turbo, gpt-4)
- count tokens or not

- keep history or not

- accepts **kwargs(key word arguments) for temperature, max_token count etc

Prints the response and the token count for each response plus the entire history plus the cost for token usage depending on the model selected

the other file is the same thing with beautiful terminal chat outputs using rich library

BONUS: Cheat sheet for Langchain:
https://github.com/Tor101/LangChain-CheatSheet

Comments

I don't think I understand what you mean :( Did I have a post like that?

Echo Hive

hi Echolive how can I access the BONUS : Cheat sheet

Mitchell

Just updated this with token cost printing for the non beautified verison. it prints the cost based on model selection

Echo Hive

updated this with a new file addition, which does the same thing as the original file but renders beautified terminal chat,

Echo Hive


More Creators