Sign up to save tools and stay up to date with the latest in AI
bg
bg
1

Creating an “Agent” Using OpenAI’s Functions API - Revelry

Aug 17, 2023 - news.bensbites.co
The article discusses the author's experiment with OpenAI's Functions API to create a language model that can return structured, machine-readable responses. The author created a module that emulates a portion of a calendar service API and asked the model to assist with simple scheduling tasks. The author was impressed by how closely the API parameters resembled what is commonly referred to as "Agents" in the AI space. The author used Elixir to write the code and Livebook to interact with it. The author also provided a detailed explanation of the code used in the experiment.

Despite being impressed with the functionality, the author noted some areas for improvement. For instance, when asked to schedule a meeting without first asking about the schedule, the model sometimes tried to use the python interpreter as a function, passing in python code to execute. The author suggests that while this can be caught, turning it into a pleasant user experience might be challenging. The author concludes by expressing excitement about exploring similar functionality in popular open-source models.

Key takeaways:

  • The author experimented with OpenAI's Functions API to create a module that emulates a portion of a calendar service API, using it to perform simple scheduling tasks.
  • He used Elixir and Livebook for coding and demonstrated how the model could understand and execute function calls to fetch and schedule events.
  • The code consists of a core module that interacts with OpenAI's API, a plugin module that exposes certain functions to the agent, and a behavior that provides the specification for callable functions.
  • While the author was impressed with the functionality, he noted some issues, such as the model trying to use the python interpreter as a function, and inconsistencies in GPT-4's responses.
View Full Article

Comments (0)

Be the first to comment!