Thursday, June 12, 2025
HomeProgrammingGPT Perform Calling: 5 Underrated Use Circumstances | by Max Brodeur-Urbas

GPT Perform Calling: 5 Underrated Use Circumstances | by Max Brodeur-Urbas


OpenAI’s backend changing messy unstructured knowledge to structured knowledge through features

OpenAI’s “Perform Calling” is perhaps probably the most groundbreaking but underneath appreciated function launched by any software program firm… ever.

Features let you flip unstructured knowledge into structured knowledge. This won’t sound all that groundbreaking however when you think about that 90% of information processing and knowledge entry jobs worldwide exist for this precise motive, it’s fairly a revolutionary function that went considerably unnoticed.

Have you ever ever discovered your self begging GPT (3.5 or 4) to spit out the reply you need and completely nothing else? No “Positive, right here is your…” or every other ineffective fluff surrounding the core reply. GPT Features are the answer you’ve been in search of.

How are Features meant to work?

OpenAI’s docs on operate calling are extraordinarily restricted. You’ll end up digging via their developer discussion board for examples of the best way to use them. I dug across the discussion board for you and have many instance developing.

Right here’s one of many solely examples you’ll be capable to discover of their docs:

features = [
{
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA",
},
"unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
},
"required": ["location"],
},
}
]

A operate definition is a inflexible JSON format that defines a operate title, description and parameters. On this case, the operate is supposed to get the present climate. Clearly GPT isn’t capable of name this particular API (because it doesn’t exist) however utilizing this structured response you’d be capable to join the actual API hypothetically.

At a excessive degree nonetheless, features present two layers of inference:

Selecting the operate itself:

It’s possible you’ll discover that features are handed into the OpenAI API name as an array. The rationale you present a reputation and outline to every operate are so GPT can determine which to make use of based mostly on a given immediate. Offering a number of features in your API name is like giving GPT a Swiss military knife and asking it to chop a chunk of wooden in half. It is aware of that regardless that it has a pair of pliers, scissors and a knife, it ought to use the noticed!

Perform definitions contribute in direction of your token depend. Passing in lots of of features wouldn’t solely take up nearly all of your token restrict but additionally end in a drop in response high quality. I typically don’t even use this function and solely move in 1 operate that I pressure it to make use of. It is vitally good to have in sure use circumstances nonetheless.

Selecting the parameter values based mostly on a immediate:

That is the actual magic for my part. GPT with the ability to select the device in it’s device equipment is superb and positively the main focus of their function announcement however I believe this is applicable to extra use circumstances.

You may think about a operate like handing GPT a type to fill out. It makes use of its reasoning, the context of the scenario and discipline names/descriptions to determine the way it will fill out every discipline. Designing the shape and the extra data you move in is the place you will get inventive.

GPT filling out your customized type (operate parameters)

One of the crucial frequent issues I exploit features for to extract particular values from a big chunk of textual content. The sender’s tackle from an e-mail, a founders title from a weblog publish, a cellphone quantity from a touchdown web page.

I prefer to think about I’m trying to find a needle in a haystack besides the LLM burns the haystack, leaving nothing however the needle(s).

GPT Knowledge Extraction Personified.

Use case: Processing 1000’s of contest submissions

I constructed an automation that iterated over 1000’s of contest submissions. Earlier than storing these in a Google sheet I wished to extract the e-mail related to the submission. Heres the operate name I used for extracting their e-mail.

{
"title":"update_email",
"description":"Updates e-mail based mostly on the content material of their submission.",
"parameters":{
"sort":"object",
"properties":{
"e-mail":{
"sort":"string",
"description":"The e-mail supplied within the submission"
}
},
"required":[
"email"
]
}
}

Assigning unstructured knowledge a rating based mostly on dynamic, pure language standards is a superb use case for features. You might rating feedback throughout sentiment evaluation, essays based mostly on a customized grading rubric, a mortgage software for danger based mostly on key elements. A current use case I utilized scoring to was scoring of gross sales leads from 0–100 based mostly on their viability.

Use Case: Scoring Gross sales leads

We had lots of of potential leads in a single google sheet just a few months in the past that we wished to deal with from most to least necessary. Every lead contained information like firm measurement, contact title, place, trade and so on.

Utilizing the next operate we scored every lead from 0–100 based mostly on our wants after which sorted them from finest to worst.

{
"title":"update_sales_lead_value_score",
"description":"Updates the rating of a gross sales lead and supplies a justification",
"parameters":{
"sort":"object",
"properties":{
"sales_lead_value_score":{
"sort":"quantity",
"description":"An integer worth starting from 0 to 100 that represents the standard of a gross sales lead based mostly on these standards. 100 is an ideal lead, 0 is horrible. Best Lead Standards:n- Medium sized corporations (300-500 staff is the most effective vary)n- Firms in major useful resource heavy industries are finest, ex. manufacturing, agriculture, and so on. (that is a very powerful standards)n- The upper up the contact place, the higher. VP or Govt degree is most well-liked."
},
"score_justification":{
"sort":"string",
"description":"A transparent and conscise justification for the rating supplied based mostly on the customized standards"
}
}
},
"required":[
"sales_lead_value_score",
"score_justification"
]
}

Outline customized buckets and have GPT thoughtfully think about every bit of information you give it and place it within the appropriate bucket. This can be utilized for labelling duties like choosing the class of youtube movies or for discrete scoring duties like assigning letter grades to homework assignments.

Use Case: Labelling information articles.

A quite common first step in knowledge processing workflows is separating incoming knowledge into completely different streams. A current automation I constructed did precisely this with information articles scraped from the net. I wished to type them based mostly on the subject of the article and embody a justification for the choice as soon as once more. Right here’s the operate I used:

{
"title":"categorize",
"description":"Categorize the enter knowledge into consumer outlined buckets.",
"parameters":{
"sort":"object",
"properties":{
"class":{
"sort":"string",
"enum":[
"US Politics",
"Pandemic",
"Economy",
"Pop culture",
"Other"
],
"description":"US Politics: Associated to US politics or US politicians, Pandemic: Associated to the Coronavirus Pandemix, Economic system: Associated to the economic system of a particular nation or the world. , Popular culture: Associated to popular culture, celeb media or leisure., Different: Would not slot in any of the outlined classes. "
},
"justification":{
"sort":"string",
"description":"A brief justification explaining why the enter knowledge was categorized into the chosen class."
}
},
"required":[
"category",
"justification"
]
}
}

Usually occasions when processing knowledge, I give GPT many potential choices and wish it to pick the most effective one based mostly on my wants. I solely need the worth it chosen, no surrounding fluff or extra ideas. Features are good for this.

Use Case: Discovering the “most attention-grabbing AI information story” from hacker information

I wrote one other medium article right here about how I automated my total Twitter account with GPT. A part of that course of includes choosing probably the most related posts from the entrance pages of hacker information. This publish choice step leverages features!

To summarize the features portion of the use case, we might scrape the primary n pages of hacker information and ask GPT to pick the publish most related to “AI information or tech information”. GPT would return solely the headline and the hyperlink chosen through features in order that I might go on to scrape that web site and generate a tweet from it.

I might move within the consumer outlined question as a part of the message and use the next operate definition:

{
"title":"find_best_post",
"description":"Decide the most effective publish that almost all intently displays the question.",
"parameters":{
"sort":"object",
"properties":{
"best_post_title":{
"sort":"string",
"description":"The title of the publish that almost all intently displays the question, acknowledged precisely because it seems within the listing of titles."
}
},
"required":[
"best_post_title"
]
}
}

Filtering is a subset of categorization the place you categorize gadgets as both true or false based mostly on a pure language situation. A situation like “is Spanish” will be capable to filter out all Spanish feedback, articles and so on. utilizing a easy operate and conditional assertion instantly after.

Use Case: Filtering contest submission

The identical automation that I discussed within the “Knowledge Extraction” part used ai-powered-filtering to weed out contest submissions that didn’t meet the deal-breaking standards. Issues like “should use typescript” have been completely necessary for the coding contest at hand. We used features to filter out submissions and trim down the full set being processed by 90%. Right here is the operate definition we used.

{
"title":"apply_condition",
"description":"Used to determine whether or not the enter meets the consumer supplied situation.",
"parameters":{
"sort":"object",
"properties":{
"choice":{
"sort":"string",
"enum":[
"True",
"False"
],
"description":"True if the enter meets this situation 'Does submission meet the ALL these necessities (makes use of typescript, makes use of tailwindcss, practical demo)', False in any other case."
}
},
"required":[
"decision"
]
}
}

In case you’re curious why I like features a lot or what I’ve constructed with them it is best to take a look at AgentHub!

AgentHub is the Y Combinator-backed startup I co-founded that allow’s you automate any repetitive or advanced workflow with AI through a easy drag and drop no-code platform.

“Think about Zapier however AI-first and on crack.” — Me

Automations are constructed with particular person nodes known as “Operators” which can be linked collectively to create energy AI pipelines. We’ve a listing of AI powered operators that leverage features underneath the hood.

Our present AI-powered operators that use features!

Try these templates to see examples of operate use-cases on AgentHub: Scoring, Categorization, Possibility-Choice,

If you wish to begin constructing AgentHub is reside and able to use! We’re very lively in our discord group and are joyful that will help you construct your automations if wanted.

Be at liberty to observe the official AgentHub twitter for updates and myself for AI-related content material.



RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments