# Function calling in node js

**URL:** <https://community.openai.com/t/function-calling-in-node-js/267742>\
**Category:** API\
**Tags:** functions\
**Created:** [June 16, 2023, 5:26pm UTC](https://community.openai.com/t/function-calling-in-node-js/267742 "2023-06-16T17:26:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pinchas.hodadad](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/pinchas.hodadad/32/36512_2.png) [@pinchas.hodadad](https://community.openai.com/u/pinchas.hodadad)\
**Post date:** [June 16, 2023, 5:26pm UTC](https://community.openai.com/t/function-calling-in-node-js/267742/1 "2023-06-16T17:26:09Z")

</div>

Hi guys. I know this is pretty early but does anybody have good code examples with function calling in node js?  
At the moment in github there are only 4 matchs.  
Would love to see examples with people who who are smarter than me.  
Thanks! 🙂

---

<div class="post-metadata">

**Author:** ![Diet](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/diet/32/562749_2.png) [@Diet](https://community.openai.com/u/Diet)\
**Post date:** [June 16, 2023, 8:16pm UTC](https://community.openai.com/t/function-calling-in-node-js/267742/2 "2023-06-16T20:16:28Z")

</div>

To be honest, I haven’t been using the openai package in quite a while now. I’m having much better results just using axios directly.

maybe this first step could clear up some hangups?

---

<div class="post-metadata">

**Author:** ![pinchas.hodadad](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/pinchas.hodadad/32/36512_2.png) [@pinchas.hodadad](https://community.openai.com/u/pinchas.hodadad)\
**Post date:** [June 17, 2023, 5:55am UTC](https://community.openai.com/t/function-calling-in-node-js/267742/3 "2023-06-17T05:55:47Z")

</div>

With function calling? Could you show me?

---

<div class="post-metadata">

**Author:** ![supershaneski](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/supershaneski/32/71779_2.png) [@supershaneski](https://community.openai.com/u/supershaneski)\
**Post date:** [June 17, 2023, 5:58am UTC](https://community.openai.com/t/function-calling-in-node-js/267742/4 "2023-06-17T05:58:46Z")

</div>

I don’t claim to be smarter than you nor can say if my code example is any good lol but here’s mine, using Next.js.

> **[GitHub - supershaneski/openai-api-function-call-sample: A sample Next.js app...](https://github.com/supershaneski/openai-api-function-call-sample)**
>
> A sample Next.js app to demonstrate the newly added function calling capabilities in OpenAI Chat Completions API - GitHub - supershaneski/openai-api-function-call-sample: A sample Next.js app to de...

---

<div class="post-metadata">

**Author:** ![pinchas.hodadad](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/pinchas.hodadad/32/36512_2.png) [@pinchas.hodadad](https://community.openai.com/u/pinchas.hodadad)\
**Post date:** [June 17, 2023, 7:23am UTC](https://community.openai.com/t/function-calling-in-node-js/267742/5 "2023-06-17T07:23:59Z")

</div>

Thanks for sharing.  
Curious though. Do you really need to put eg in every parameter description?

---

<div class="post-metadata">

**Author:** ![supershaneski](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/supershaneski/32/71779_2.png) [@supershaneski](https://community.openai.com/u/supershaneski)\
**Post date:** [June 17, 2023, 8:12am UTC](https://community.openai.com/t/function-calling-in-node-js/267742/6 "2023-06-17T08:12:07Z")

</div>

I am not sure. I just followed the sample code OpenAI gave and thought maybe it will be used as some sort of like **few shot prompt** internally.

---

<div class="post-metadata">

**Author:** ![normandmickey](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/normandmickey/32/1590_2.png) [@normandmickey](https://community.openai.com/u/normandmickey)\
**Post date:** [June 28, 2023, 2:39am UTC](https://community.openai.com/t/function-calling-in-node-js/267742/7 "2023-06-28T02:39:57Z")

</div>

Try this. Complete demonstration to return time and weather using API calls.

> **[GitHub - normandmickey/node-chatgpt-api-with-function-calls](https://github.com/normandmickey/node-chatgpt-api-with-function-calls/tree/main)**
>
> main

---

<div class="post-metadata">

**Author:** ![avayu](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/avayu/32/280667_2.png) [@avayu](https://community.openai.com/u/avayu)\
**Post date:** [December 27, 2023, 1:08pm UTC](https://community.openai.com/t/function-calling-in-node-js/267742/8 "2023-12-27T13:08:27Z")

</div>

Hey Shaneski  
Thank you very much for your public repo, is there a way to contact you privately? In case you answer questions i would love to have a short back and forth.

Best  
Dominik
