All streams
Search
Write a publication
Pull to refresh

GPT-4o в командной строке бесплатно.

 pip install g4f 
from g4f.client import Client 
 
client = Client() 
 
 
def answer(question: str) -> str: 
 
    response = client.chat.completions.create( 
        model="gpt-4o", 
        messages=[{"role": "user", "content": question}], 
    ) 
    return response.choices[0].message.content 
 
def main(): 
    while True: 
        question = input('\nВведите ваш вопрос > ') 
        print(answer(question)) 
 
 
if __name__ == '__main__': 
    main() 

Если что-то непонятно, запустите скрипт и задайте свой вопрос.

Tags:
Total votes 5: ↑5 and ↓0+7
Comments3

Articles