You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Written by [sife-shuo](https://github.com/sife-shuo/).
3
+
4
+
## Description
5
+
Unlike gpt4free. italygpt in the pypi package, italygpt2 supports stream calls and has changed the request sending method to enable continuous and logical conversations.
6
+
7
+
The speed will increase when calling the conversation multiple times.
8
+
9
+
### Completion:
10
+
```python
11
+
account_data=italygpt2.Account.create()
12
+
for chunk in italygpt2.Completion.create(account_data=account_data,prompt="Who are you?"):
13
+
print(chunk, end="", flush=True)
14
+
print()
15
+
```
16
+
17
+
### Chat
18
+
Like most chatgpt projects, format is supported.
19
+
Use the same format for the messages as you would for the [official OpenAI API](https://platform.openai.com/docs/guides/chat/introduction).
20
+
```python
21
+
messages = [
22
+
{"role": "system", "content": ""},#...
23
+
{"role": "user", "content": ""}#....
24
+
]
25
+
account_data=italygpt2.Account.create()
26
+
for chunk in italygpt2.Completion.create(account_data=account_data,prompt="Who are you?",message=messages):
0 commit comments