How do you pass context ( can be anything like dbconnection, a python object etc.) to agent Function Tools ? #72
Replies: 2 comments
-
Can you provide an example/pseudo code of what you'd like to do? Are you attempting to use a dependency from a tool/agent or are you trying to modify the state of an agent from a tool? |
Beta Was this translation helpful? Give feedback.
-
I think the best approach for now is not trying to pass complex objects to the tool but use an environment variable for example to build your dbconnection inside of the tool. An envar or any other string based object can be injected into your system_prompt during runtime so you can use it to build your dbconnection object inside of the tool. Here's an example:
You might want to encrypt strings before sending them to the llm and decrypt them in the tool. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I would like to know how can we pass Dependency information like a dbconnection object to a Tool function or an agent ?
Beta Was this translation helpful? Give feedback.
All reactions