text_completions_demo_sync.py 339 B

1234567891011121314
  1. from g4f.client import Client
  2. client = Client()
  3. response = client.chat.completions.create(
  4. model="gpt-4o",
  5. messages=[
  6. {"role": "system", "content": "You are a helpful assistant."},
  7. {"role": "user", "content": "how does a court case get to the Supreme Court?"}
  8. ],
  9. )
  10. print(response.choices[0].message.content)