strawberry/strawberry.py

25 lines
626 B
Python
Raw Normal View History

2024-08-09 19:00:56 -05:00
import os
2024-08-10 11:33:32 -05:00
from openai import OpenAI
2024-08-09 19:00:56 -05:00
2024-08-12 22:41:26 -05:00
import agentops
agentops.init(api_key=os.environ['AGENTOPS_API_KEY'])
2024-08-10 11:33:32 -05:00
beta_headers = {
"authorization": f"Bearer {os.environ['OPENAI_BETA_KEY']}",
"openai-beta": "early-access-strawberry"
}
2024-08-09 19:00:56 -05:00
2024-08-10 11:33:32 -05:00
client = OpenAI(default_headers=beta_headers)
2024-08-09 19:00:56 -05:00
2024-08-10 11:33:32 -05:00
completion = client.chat.completions.create(
2024-08-12 22:41:26 -05:00
model="gpt-4o-large-2024-08-13",
messages=[
{"role": "system", "content": "use your level two capabilities"},
{"role": "user", "content": "give us ubi"}
]
2024-08-10 11:33:32 -05:00
)
2024-08-09 19:00:56 -05:00
2024-08-10 11:33:32 -05:00
print(completion.choices[0].message)
2024-08-12 22:41:26 -05:00
agentops.end_session("Success", end_state_reason="AGI achieved 🖇️")