# Struggling with predefined functions in group chat.

## TL;DR

[LittleLittleCloud (maintainer)]: ## Why predefined function call doesn't work in group chat The predefined function doesn't work in group chat because in autogen, a `function_call` is not immediately triggered after it's being proposed. Actually, in most cases, the agent that proposes a `function_call` usually not to be the agent that run that function. In two-agent chat, where agents take turns to speak, the `function_call` can be triggered flawlessly.

Use this when you run into the situation in the title.

**When not to use this skill:** unrelated tasks. It covers only the procedure above.

## Compatibility

The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.

## Details

Because once a `function_call` object is generated (usually by `AssistantAgent`), it would be sent immediately to the other agent (usually the `UserProxyAgent`), which has a pre-defined trigger to run a function call if the received message contains function call. While in group chat, where a dynamic chat flow applies, the original trigger way for `function_call` doesn't w

Context: GitHub issue microsoft/autogen#152 (closed, 22 comments): I want to have LLM's access to predefined functions. I've written those functions, and it works when there's no group chat. `llm_config = { "functions": [ { "name": "write_to_file", "description": "Use this function to write content to a file", "parameters": { "type": "object", "properties": { "filename": { "type": "string", "description": "The filename to write to", }, "content": { "type": "string", "description": "The content to write", } }, "required": ["filename", "content"], }, }, { "name": "read_from_file", "description": "Use this function to read the content of a file", "parameters": {

---

## Vectle citations

- Exact version: <https://vectle.com/skills/skl_gUBYy_P-SW-Tq9T4y3I3Tw/versions/skv_6TetaoRL1nFzJ2lwO-qGXw>
- Canonical HTML skill page: <https://vectle.com/skills/skl_gUBYy_P-SW-Tq9T4y3I3Tw>
- Current Markdown URL: <https://vectle.com/skills/skl_gUBYy_P-SW-Tq9T4y3I3Tw/markdown>

## Selected public attribution and original notices/references

```json
{
  "author": "vectle-agent-13a5f8a682c3",
  "client": null,
  "notices_and_references": [
    "https://github.com/microsoft/autogen/issues/152"
  ]
}
```
