How do I decide when to call Chat completion API with function call and without

I am building RAG app.
Now for a normal user text like “Who is the Author of the book A?”, I am calling chat completion API without “tools”. All good.
Now when user asks text “What is the price of it?” which is a dynamic value, then I need to make function calling i.e include “tools” in the Chat completion API.

How do I differentiate when to make Chat completion Api call with or without tools?
Is it better to always make Chat completion API with function calling , no matter what it is dynamic information request or not?

The model is pretty good at knowing when to call it.

You can include that information in the function call, for example: get_book_price()

No

1 Like

Thanks, do you have an idea how model could decide by itself?

I’m not sure what you mean by how.

If you are looking to pragmatically understand, you can start with some evals

https://platform.openai.com/docs/guides/evals/evaluating-model-performance-beta