Created
July 12, 2023 06:14
-
-
Save alonsosilvaallende/824dce30a2ac04f09860be5bba4acd55 to your computer and use it in GitHub Desktop.
llmOpenRouter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def llm(text: str) -> str: | |
return openai.ChatCompletion.create( | |
model='openai/gpt-4', | |
headers={ | |
"HTTP-Referer": OPENROUTER_REFERRER | |
}, | |
messages=[{ | |
'role': 'user', | |
'content': f'{text}' | |
}], | |
temperature=0.9).choices[0].message.content |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment