# Function\_calling\_llm not working

**URL:** <https://community.crewai.com/t/function-calling-llm-not-working/559>\
**Category:** General\
**Created:** [September 27, 2024, 1:27am UTC](https://community.crewai.com/t/function-calling-llm-not-working/559 "2024-09-27T01:27:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![moto](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@moto](https://community.crewai.com/u/moto)\
**Post date:** [September 27, 2024, 1:27am UTC](https://community.crewai.com/t/function-calling-llm-not-working/559/1 "2024-09-27T01:27:19Z")

</div>

it seems like crewai is ignoring function\_calling\_llm parameter directly and when you put it in the yaml file it throws an error. (specifying in the yaml, the same llm as in llm: gpt4o) works fine. just doesn’t work as function\_calling\_llm: gpt4o and no other model does either. anyone else seeing this?

for example this in the yaml file,  
function\_calling\_llm: gpt4o

and this in the def of that llm,  
@llm  
def gpt4o(self):  
return LLM(model=“openai/gpt-4o”, temperature=0.2, top\_p=0.2)

results in,  
ile “/Users/ai/anaconda3/envs/crewaitestbed/lib/python3.11/site-packages/crewai/project/crew\_base.py”, line 37, in **init**  
self.map\_all\_agent\_variables()  
File “/Users/ai/anaconda3/envs/crewaitestbed/lib/python3.11/site-packages/crewai/project/crew\_base.py”, line 89, in map\_all\_agent\_variables  
self.\_map\_agent\_variables(  
File “/Users/ai/anaconda3/envs/crewaitestbed/lib/python3.11/site-packages/crewai/project/crew\_base.py”, line 121, in \_map\_agent\_variables  
self.agents\_config[agent\_name][“function\_calling\_llm”] = agents[  
^^^^^^^  
KeyError: ‘gpt4o’

---

<div class="post-metadata">

**Author:** ![matt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/matt/32/3_2.png) [@matt](https://community.crewai.com/u/matt)\
**Post date:** [September 27, 2024, 10:02am UTC](https://community.crewai.com/t/function-calling-llm-not-working/559/2 "2024-09-27T10:02:29Z")

</div>

Pretty sure you cannot add function calling llm via YAML as there is no annotation for it

---

<div class="post-metadata">

**Author:** ![moto](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@moto](https://community.crewai.com/u/moto)\
**Post date:** [September 27, 2024, 8:34pm UTC](https://community.crewai.com/t/function-calling-llm-not-working/559/3 "2024-09-27T20:34:34Z")

</div>

I thought all standard attributes of agents were allowed in the yaml file? If not then which ones are?

---

<div class="post-metadata">

**Author:** ![matt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/matt/32/3_2.png) [@matt](https://community.crewai.com/u/matt)\
**Post date:** [September 28, 2024, 12:38am UTC](https://community.crewai.com/t/function-calling-llm-not-working/559/4 "2024-09-28T00:38:48Z")

</div>

> <https://github.com/crewAIInc/crewAI/blob/main/src/crewai/project/annotations.py>
