If else condition for GPT

Hi , I am new in the field of openAI API and still exploring. I am using gpt3.5 turbo in my current project. In some cases i am not getting the proper response and have to use gpt-4 to acheive that. I am quite curious to know if I can use if else condition .
For example.
When I asked to give the total sales for the year 2024 - gpt-3.5-turbo gave the perfect ans.
But when iIasked which year has the highest sales - gpt-3.5-turbo started giving the wrong answer and I have to jump to gpt-4 model to get the proper answer.
So is there any possibility to use if else such as if the keywords are highest or lowest then it should give answer from gpt-4 else from gpt3.5 . Will the condition work properly ?

Using if/else in your code will trigger based on the conditions you set. You’ll have to write the code for these conditions and test it to figure out whether or not this will work properly for your specific application.

1 Like

For even a little bit complex reasoning question, u should use GPT4.
If using code, u can differ it using nlp library such as spacy or bert, they can recognize basic semantic.
Or in advance u can use llm’s function cal to differ semantic.
It’s not recommended to differ directly by python’s if else code with no semantic ability.

In addition, web chatgpt has the ability to switch models automatically, but it’s not in control by us!

1 Like

ChatGPT doesn’t switch models automatically, but you can do so by clicking the button here:

2 Likes

well, i used if else and it worked. i have to do a deep test to check though. thanks

2 Likes

Well, I am using c# language and has to work with NLP Library in c# . So I thought to save some tokens and the condition worked . I have a simple data sheet now. But yes thanks for letting me know about the NLP library. I will research on them as how to use in c#

1 Like

Month ago, there’s a automatic switch model function in the model list, it’s removed, it seems no such function anymore, however gpt4o is the answer😄