gpt4free icon indicating copy to clipboard operation
gpt4free copied to clipboard

OpenAIchat

Open gamelist1990 opened this issue 11 months ago • 2 comments

Please tell me how to use provider g4f.Provider.OpenaiChat with Legacy API I also set access_token but no answer from AI is returned

gamelist1990 avatar Mar 08 '24 03:03 gamelist1990

Here a full example with the legacy api:

    import g4f
    
    response = g4f.ChatCompletion.create(
        model=g4f.models.default,
        provider=g4f.Provider.OpenaiChat,
        messages=[{"role": "user", "content": "say hello in german!"}],
        access_token="..."
    )
    print(response)

hlohaus avatar Mar 08 '24 15:03 hlohaus

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

github-actions[bot] avatar Mar 16 '24 00:03 github-actions[bot]