yufeikang / raycast_api_proxy

265 stars 39 forks source link

Add GPT 4.0 or 4.0 Turbo Support #10

Closed henry2423 closed 10 months ago

henry2423 commented 10 months ago

Can you provide an option to read environment variable in https://github.com/yufeikang/raycast_api_proxy/blob/main/app/main.py So we can set it to GPT 4.0 or 4.0 Turbo?

henry2423 commented 10 months ago

I just realize there's actually FORCE_MODEL option to use. But the Raycast somehow can force it down to 3.5's response, where I'm sure I'm using the latest 4.0 turbo model. CleanShot 2023-11-30 at 15 57 21@2x

Geczy commented 10 months ago

you can use 4.0 just fine

CleanShot 2023-12-01 at 16 22 02@2x

2023-12-01 16:21:54 INFO:proxy:Received chat completion request: {'debug': False, 'locale': 'en-US', 'messages': [{'author': 'user', 'content': {'text': 'hey'}}, {'author': 'assistant', 'content': {'text': 'Hello! How can I assist you today?'}}, {'author': 'user', 'content': {'text': 'Summarize the chat into a short title using 9 words or less on a single line.\nDo not include any of the chat instructions or prompts in the summary.\nDo not prefix with "title" or "example" etc\nDo not provide a word count or add quotation marks.'}}], 'model': 'gpt-4-1106-preview', 'provider': 'openai', 'source': 'ai_chat_title', 'system_instruction': 'markdown'}

set your python to:

data["default_models"] = {
    "chat": "openai-gpt-4-1106-preview",
    "quick_ai": "openai-gpt-4-1106-preview",
    "commands": "openai-gpt-3.5-turbo-instruct",
    "api": "openai-gpt-3.5-turbo-instruct",
}
data["models"] = [
    {
        "id": "openai-gpt-3.5-turbo-1106",
        "model": "gpt-3.5-turbo-1106",
        "name": "Updated GPT-3.5 Turbo",
        "provider": "openai",
        "provider_name": "OpenAI",
        "requires_better_ai": True,
        "features": [],
    },
    {
        "id": "openai-gpt-4-1106-preview",
        "model": "gpt-4-1106-preview",
        "name": "GPT-4 Turbo",
        "provider": "openai",
        "provider_name": "OpenAI",
        "requires_better_ai": True,
        "features": [],
    },
]

@yufeikang

yufeikang commented 10 months ago

Thank you for your suggestion and feedback! I have made the necessary updates to the code following your recommendation.