# Any workarounds for function calling using gpt-4-vision-preview?

**URL:** <https://community.openai.com/t/any-workarounds-for-function-calling-using-gpt-4-vision-preview/627173>\
**Category:** API\
**Tags:** gpt-4, gpt-4-vision\
**Created:** [February 15, 2024, 12:46am UTC](https://community.openai.com/t/any-workarounds-for-function-calling-using-gpt-4-vision-preview/627173 "2024-02-15T00:46:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rachiket-jackett](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/rachiket-jackett/32/226866_2.png) [@rachiket-jackett](https://community.openai.com/u/rachiket-jackett)\
**Post date:** [February 15, 2024, 12:46am UTC](https://community.openai.com/t/any-workarounds-for-function-calling-using-gpt-4-vision-preview/627173/1 "2024-02-15T00:46:50Z")

</div>

As everyone is aware, gpt-4-vision-preview does not have function calling capabilities yet. Therefore, there’s no way to provide external context to the GPT-4V model that’s not a part of what the “System”, “Assistant” or the “User” provides.

I’m curious if anyone has figured out a workaround to make sure the external context is injected in a reliable manner?

_A different form of this question would be:_

Any idea if there is a way to use gpt-4-vision-preview as the base model for a ReAct agent?

---

<div class="post-metadata">

**Author:** ![\_j](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/_j/32/766292_2.png) [@\_j](https://community.openai.com/u/_j)\
**Post date:** [February 15, 2024, 1:40am UTC](https://community.openai.com/t/any-workarounds-for-function-calling-using-gpt-4-vision-preview/627173/2 "2024-02-15T01:40:29Z")

</div>

gpt-4-vision doesn’t take functions, doesn’t take logprobs or logit\_bias. They pretty much keep the utility of ChatGPT to themselves.

You’d likely have to provide a regular model an “analyze image” function, with a “prompt” parameter of the desired text to get back. Then inject post-prompt that says “user has made banana-tree.jpg available to the analyze image function”.

---

<div class="post-metadata">

**Author:** ![dan.raviv](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/dan.raviv/32/146362_2.png) [@dan.raviv](https://community.openai.com/u/dan.raviv)\
**Post date:** [March 1, 2024, 8:52pm UTC](https://community.openai.com/t/any-workarounds-for-function-calling-using-gpt-4-vision-preview/627173/3 "2024-03-01T20:52:19Z")

</div>

Function calling is just a way to easily structure the input-output for tool calling. You can use GPT4-vision in the same way but without this structured output. For example, tell it that if it needs to use tool X, output a json format with the tool name and parameters, and then parse the output as you would a function call, and simply add the function output as another regular user message.

---

<div class="post-metadata">

**Author:** ![viroscope](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/viroscope/32/206276_2.png) [@viroscope](https://community.openai.com/u/viroscope)\
**Post date:** [March 8, 2024, 2:08am UTC](https://community.openai.com/t/any-workarounds-for-function-calling-using-gpt-4-vision-preview/627173/4 "2024-03-08T02:08:51Z")

</div>

How about using function calling, to make it use function calling.

Standard Non vision model with function calling  
Image\_conversation  
if user wants information about an image in context  
url image url

Image conversation function that makes a call to vision with the image of context format for image stuff

Just a rando thought

(or function calling for the first response and the followup use vision?)

---

<div class="post-metadata">

**Author:** ![stevenic](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@stevenic](https://community.openai.com/u/stevenic)\
**Post date:** [March 8, 2024, 2:39am UTC](https://community.openai.com/t/any-workarounds-for-function-calling-using-gpt-4-vision-preview/627173/5 "2024-03-08T02:39:26Z")

</div>

You can use AlphaWave with GPT-4V to reliably return a JSON object specifying the name of a function to call and the parameters to pass that function.

> **[alphawave](https://pypi.org/project/alphawave/)**
>
> AlphaWave-py - Functions for smaller Large Language Models (sLLMs)

There’s nothing magical that OpenAI is doing to support function calling. They’re just adding some text to the end of your prompt describing a list of available functions and then asking the model to return some JSON. You can do that just as easily yourself.

AlphaWave actually enables more reliable function calling because it not only ensures the model returns valid JSON but it also schema validates everything. It makes it impossible for the model to call an invalid function or to return invalid parameters. OpenAI makes no such guarantees.

---

<div class="post-metadata">

**Author:** ![merefield](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/merefield/32/14812_2.png) [@merefield](https://community.openai.com/u/merefield)\
**Post date:** [April 10, 2024, 6:54am UTC](https://community.openai.com/t/any-workarounds-for-function-calling-using-gpt-4-vision-preview/627173/6 "2024-04-10T06:54:21Z")

</div>

See update here:

> [@Does the model \`gpt-4-vision-preview\` have function calling?](https://community.openai.com/t/does-the-model-gpt-4-vision-preview-have-function-calling/490197/17):
>
> So I gave up and wrote a function. With hindsight this has one huge advantage: you can use a cheaper LLM to hold the general conversation and restrict calls to GPT 4 Vision for just image analysis. UPDATE: looks like Open AI released an updated preview model with vision with function calling: gpt-4-1106-vision-preview (but as usual the alias gpt-4-vision-preview points to this latest model) More here: [https://platform.openai.com/docs/models/continuous-model-upgrades](https://platform.openai.com/docs/models/continuous-model-upgrades) My solution is stil…
