Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: A more modular way of registering a function with an agent. #2993

Open
tyler-suard-parker opened this issue Jun 21, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@tyler-suard-parker
Copy link
Contributor

tyler-suard-parker commented Jun 21, 2024

Is your feature request related to a problem? Please describe.

I like Autogen better than Semantic Kernel, but one thing that Semantic Kernel does really well is making its functions available to agents in a very modular way. For example, in autogen we need to create a long dictionary of functions, and in order to add a function to our project and to an agent, we have to modify that dictionary. Here is an example:

llm_config = {
   "functions": [
       {
           "name": "define_function",
           "description": "Define a function to add to the context of the conversation. Necessary Python packages must be declared. Once defined, the assistant may decide to use this function, respond with a normal message.",
           "parameters": {
               "type": "object",
               "properties": {
                   "name": {
                       "type": "string",
                       "description": "The name of the function to define.",
                   },
                   "description": {
                       "type": "string",
                       "description": "A short description of the function.",
                   },
                   "arguments": {
                       "type": "string",
                       "description": 'JSON schema of arguments encoded as a string. For example: { "url": { "type": "string", "description": "The URL", }}',
                   },
                   "packages": {
                       "type": "string",
                       "description": "A list of package names imported by the function, and that need to be installed with pip prior to invoking the function. This solves ModuleNotFoundError.",
                   },
                   "code": {
                       "type": "string",
                       "description": "The implementation in Python. Do not include the function declaration.",
                   },
               },
               "required": ["name", "description", "arguments", "packages", "code"],
           },
       },
   ],
   "config_list": config_list,
   "request_timeout": 120,
}

Semantic Kernel, on the other hand, stores each function in a separate file as a "plugin". In order to make the agent aware of the function, they simply call

kernel.import_skill(skill_name).  

It would be nice to have that functionality in Autogen, as it would simplify the process of adding new functions.

Describe the solution you'd like

from functions import web_search_function

assistant_agent.add_function(web_search_function)

The assistant agent can now use that function, and is aware of its description and required inputs and outputs.

Additional context

No response

@tyler-suard-parker tyler-suard-parker added the enhancement New feature or request label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant