How do i create tools that need credentials? #2636
Nathan-Intergral
started this conversation in
General
Replies: 1 comment 4 replies
-
Could you provide an example of how this solves your problem? If you want to have different credentials for different instance of invocation, you can use a simple function wrapper. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I was wondering if someone could help me out that something that has been a sore point for a while in my application.
I started out making my autogen application following the docs for adding tools the standard way, using the
register_for_llm
etc etc. However quickly ran in to a problem when i needed to provide auth credentials for an account in the tool for an api call. I ended up trying to solve this with a singleton to store these details but realised quickly that wouldn't work as am working with a service that accepts requests from multiple tenants at any given time.I ended up switching to using functions and using Langchain Tool classes so that i could initialise the class with any parameters i wanted, auth token etc. Which is working for me now.
However, i have recently learned that functions are a deprecated feature of OpenAI and theres several downsides to using functions over tools. With that in mind, id like to switch back to tools but I have no idea how to get around the issue i described above.
Does anyone know how i can provide parameters like auth headers, contexts etc to tools in a multi tenant environment?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions