Upload try_free_gpt4.py with huggingface_hub
Browse files- try_free_gpt4.py +9 -0
try_free_gpt4.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from g4f.client import Client
|
| 2 |
+
|
| 3 |
+
client = Client()
|
| 4 |
+
response = client.chat.completions.create(
|
| 5 |
+
model="gpt-4o",
|
| 6 |
+
messages=[{"role": "user", "content": "Tell me about the ACL conference"}],
|
| 7 |
+
|
| 8 |
+
)
|
| 9 |
+
print(response.choices[0].message.content)
|