Download testing/aiservice/testing.py from Ritori/GPT4: direct link, hf CLI and curl.
- Browser
- Download file 1.14 kB
-
https://huggingface.co/spaces/Ritori/GPT4/resolve/main/testing/aiservice/testing.py
- Command line
-
hf download hf://spaces/Ritori/GPT4/testing/aiservice/testing.py
-
curl -L -o testing.py https://huggingface.co/spaces/Ritori/GPT4/resolve/main/testing/aiservice/testing.py
1.14 kB
| from AiService import ChatCompletion | |
| # Test 1 | |
| response = ChatCompletion.create(model="gpt-3.5-turbo", | |
| provider="AiService", | |
| stream=False, | |
| messages=[{'role': 'user', 'content': 'who are you?'}]) | |
| print(response) | |
| # Test 2 | |
| response = ChatCompletion.create(model="gpt-3.5-turbo", | |
| provider="AiService", | |
| stream=False, | |
| messages=[{'role': 'user', 'content': 'what you can do?'}]) | |
| print(response) | |
| # Test 3 | |
| response = ChatCompletion.create(model="gpt-3.5-turbo", | |
| provider="AiService", | |
| stream=False, | |
| messages=[ | |
| {'role': 'user', 'content': 'now your name is Bob'}, | |
| {'role': 'assistant', 'content': 'Hello Im Bob, you asistant'}, | |
| {'role': 'user', 'content': 'what your name again?'}, | |
| ]) | |
| print(response) |