Initial commit

This commit is contained in:
Zach
2025-04-02 16:56:35 -04:00
committed by GitHub
commit 41ecb66b4a
13 changed files with 5254 additions and 0 deletions

14
utils/call_llm.py Normal file
View File

@@ -0,0 +1,14 @@
from openai import OpenAI
# Learn more about calling the LLM: https://the-pocket.github.io/PocketFlow/utility_function/llm.html
def call_llm(prompt):
client = OpenAI(api_key="YOUR_API_KEY_HERE")
r = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": prompt}]
)
return r.choices[0].message.content
if __name__ == "__main__":
prompt = "What is the meaning of life?"
print(call_llm(prompt))