Boilerplate Python functions to make calls to Openai API chatcompletions
Added 2023-03-30 18:38:17 +0000 UTCgeneral_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
2023-08-04 17:39:56 +0000 UTChi Echolive how can I access the BONUS : Cheat sheet
Mitchell
2023-08-04 15:45:55 +0000 UTCJust updated this with token cost printing for the non beautified verison. it prints the cost based on model selection
Echo Hive
2023-03-30 20:40:06 +0000 UTCupdated this with a new file addition, which does the same thing as the original file but renders beautified terminal chat,
Echo Hive
2023-03-30 19:23:32 +0000 UTC