Download testing/test_chat_completion.py from OpkaGames/NeuroGPT: direct link, hf CLI and curl.
- Browser
- Download file 325 Bytes
-
https://huggingface.co/spaces/OpkaGames/NeuroGPT/resolve/main/testing/test_chat_completion.py
- Command line
-
hf download hf://spaces/OpkaGames/NeuroGPT/testing/test_chat_completion.py
-
curl -L -o test_chat_completion.py https://huggingface.co/spaces/OpkaGames/NeuroGPT/resolve/main/testing/test_chat_completion.py
325 Bytes
| import sys | |
| from pathlib import Path | |
| sys.path.append(str(Path(__file__).parent.parent)) | |
| import g4f | |
| stream = False | |
| response = g4f.ChatCompletion.create( | |
| model="gpt-3.5-turbo", | |
| provider=g4f.Provider.Ails, | |
| messages=[{"role": "user", "content": "hello"}], | |
| stream=stream, | |
| active_server=5, | |
| ) | |
| print(response) | |