Message possible type - role: tool. How to use that?

I notice there is tool message in chat api. I don’t know how to use that.

Could u give me a practice to use that?

Can you add more details? Are you talking about tool option in Assistant APIs?

I refer this

I’m not sure how to use that?

API Reference - OpenAI API

1 Like

A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.

So, the tool can only be used for Function Calling. Here’s what Function Calling is and read this article on How to call functions with chat models

If you have any specific question in the code or implementation, please let us know.

Thanks a lot. It helps me a lot.

By the way, how do you find these related docs? This may help so that next time you encounter a similar problem, I won’t need to seek help on the forum.

If you look on the sidebar menu on the left, or the top of the main view of this very forum, or the top of your account management at platform.openai.com, you will see both “Documentation” and “API Reference”. Then it is just a matter of negotiation of huge web pages.

1 Like

The "role": "tool" isn’t a role that’s normally used. It’s only used when providing a response to the model’s tool call.

Regarding navigating the docs, you can use the sidebar as @_j suggested to find the resources.

In the docs and API reference, you can use the search option to find what you’re looking for.

2 Likes