Running a Custom Tool and Agent Locally
This is an example of how to run a custom tool and agent locally, independent of GLChat.
This documentation has been deprecated and moved to the GL SDK Gitbook
Installation
# you can use a Conda environment
pip install gllm-agents-binary
Running The Code
git clone https://github.com/GDP-ADMIN/gen-ai-examples.git
cd gen-ai-examples/examples/custom-tool-and-agent
Set up your OPENAI_API_KEY
OPENAI_API_KEY
Get your OpenAI API key from https://platform.openai.com/api-keys.
export OPENAI_API_KEY="sk-..."
Execute the script
python hello_agent_example.py
With verbose=True
, you will see the agent's thinking process, which may look like this:
> Entering new AgentExecutor chain... Invoking: `simple_hello_tool` with `{'name': 'World'}` Hello, World! > Finished chain. Hello, World!
The key indicators of success:
The agent initialization completes without errors
The verbose output shows the tool being invoked
The final output includes the greeting "Hello, World!"
Last updated