gpt / gpt4free /etc /examples /text_completions_demo_sync.py
LoRDxdd's picture
Add gpt4free API for Hugging Face
a4b70d9
from g4f.client import Client
client = Client()
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "how does a court case get to the Supreme Court?"}
],
)
print(response.choices[0].message.content)