ansari-project / ansari-backend

Ansari is an AI assistant to help Muslims practice more effectively and non-Muslims to understand Islam
77 stars 14 forks source link

Switch function implementation to tools #33

Closed waleedkadous closed 1 day ago

waleedkadous commented 7 months ago

Currently we use OpenAI's function implementation. This is deprecated now. Instead OpenAI have a new abstraction, tools. Tools are more flexible (e.g. you can run multiple tools at the same time), and are compatible with Claude.

OdyAsh commented 1 month ago

Hello there!

Ironically enough, before I saw this backlog, I previously created a fork just to change this deprecation, as I wanted to try out Grok instead of OpenAI (just to compare the models for myself :]). Sadly though, it seems that Grok models expect only functions as tools, and not classes like SearchQuran/SearchHadith...

Nevertheless, The code presented in this fork's branch should fix the deprecation issue, however I can't test this myself since I don't have an OpenAI key. Hopefully, it serves as a good starting basis for code migration! 🙌

The pull request of this branch can be found here.