#The functions. namespace in function calling?

6 messages · Page 1 of 1 (latest)

supple creek
#

Hi,

I successfully ran the stock langchain and stopwatch examples, but somehow my own function is not found. My function is in the same file as the agent config code, but It's being called as functions.analyze_image (probably because https://github.com/microsoft/autogen/blob/main/autogen/agentchat/conversable_agent.py#L2146 uses the functions.namespace) . But there is no such namespace, so I'm confused.

Relevant chatbot-to-user proxy message:
Again, you can fetch and analyze the image in a similar way:

import requests

img_data = requests.get(url).content
with open('image.png', 'wb') as handler:
  handler.write(img_data)

# Analyzing the fetched image
functions.analyze_image(filename='image.png')
GitHub

Enable Next-Gen Large Language Model Applications. Join our Discord: https://discord.gg/pAbnFJrkgZ - microsoft/autogen

sage quartz
#

<@&1206272576914194552>

blazing vortex
#

Would love to see the your code. Curious what is the functions.namespace you refer to?

supple creek
blazing vortex
#

cc @limber ore @lament jacinth

I see. register_function only puts the function in the user proxy’s function map. It doesn’t put inside the code execution environment. You can try to change your initial message to convince the LLM to use tool/function provided rather than say “write Python code”, which leads the LLM to generate code blocks instead.

We have plan to put the registered functions inside code execution environment, so what you are doing will work as well. If you are interested in update you can check the #agent-coding channel.

supple creek