Search code examples
openai-apichatgpt-api

getting model not found for text completion (g4f)


I want to prompt g4f with a simple question but the exception I get each time was model not found:

import g4f

allowed_models = [
    'code-davinci-002',
    'text-ada-001',
    'text-babbage-001',
    'text-curie-001',
    'text-davinci-002',
    'text-davinci-003'
]

response = g4f.Completion.create(
    model='text-davinci-003',
    prompt='say this is a test'
)

print(response)

any idea how to remedy to this?


Solution

  • enter image description here

    For OpenAI Provider, g4f only support 3 models: gpt-3.5-turbo, gpt-4, gpt-4-turbo.