Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
Fix Provider ChatGPTAI with GPT-4 model
Browse files Browse the repository at this point in the history
  • Loading branch information
ramon-victor committed Jul 17, 2023
1 parent 649b258 commit 9056a26
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<option value="gpt-3.5-turbo-16k-0613" selected>
GPT-3.5-turbo-16k-0613
</option>
<option value="gpt-4" disabled>GPT-4 (offline)</option>
<option value="gpt-4">GPT-4</option>
</select>
</div>
<div class="field">
Expand Down
4 changes: 2 additions & 2 deletions g4f/Provider/Providers/ChatgptAi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
supports_stream = True
needs_auth = False


def _create_completion(model: str, messages: list, stream: bool, **kwargs):
chat = ''
for message in messages:
chat += '%s: %s\n' % (message['role'], message['content'])
chat += 'assistant: '

response = requests.get('https://chatgpt.ai/gpt-4/')

response = requests.get('https://chatgpt.ai/')
nonce, post_id, _, bot_id = re.findall(r'data-nonce="(.*)"\n data-post-id="(.*)"\n data-url="(.*)"\n data-bot-id="(.*)"\n data-width', response.text)[0]

headers = {
Expand Down
2 changes: 1 addition & 1 deletion g4f/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class gpt_4_dev:
class gpt_4:
name: str = 'gpt-4'
base_provider: str = 'openai'
best_provider: Provider.Provider = Provider.Dfehub
best_provider: Provider.Provider = Provider.ChatgptAi

class gpt_4_0613:
name: str = 'gpt-4-0613'
Expand Down

0 comments on commit 9056a26

Please sign in to comment.