Add llama-index-tools-heroku integration#20606
Open
dsouza-anush wants to merge 1 commit intorun-llama:mainfrom
Open
Add llama-index-tools-heroku integration#20606dsouza-anush wants to merge 1 commit intorun-llama:mainfrom
dsouza-anush wants to merge 1 commit intorun-llama:mainfrom
Conversation
Adds agent tools for Heroku Agents API integration. Features: - HerokuToolSpec class with SQL, Python, and JavaScript execution - Integration with Heroku Agents API - Compatible with LlamaIndex ReActAgent and FunctionCallingAgent Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
AstraBert
requested changes
Feb 2, 2026
Member
There was a problem hiding this comment.
Same comment as per the rerank integration, you should use uv + hatchling and not poetry in the pyproject
| return self._call_agent_tool("app_info", {}) | ||
|
|
||
|
|
||
| def create_heroku_tools( |
Member
There was a problem hiding this comment.
nit on naming: maybe get_heroku_tools is better
Comment on lines
+82
to
+109
| async def _acall_agent_tool(self, tool_name: str, tool_input: dict) -> str: | ||
| """Async call a Heroku Agents API tool. | ||
|
|
||
| Args: | ||
| tool_name: The name of the tool to call. | ||
| tool_input: The input parameters for the tool. | ||
|
|
||
| Returns: | ||
| The tool execution result as a string. | ||
| """ | ||
| response = await self._async_client.post( | ||
| f"{self.base_url}/v1/agents/heroku", | ||
| headers=self._get_headers(), | ||
| json={ | ||
| "app_name": self.app_name, | ||
| "tool_choice": { | ||
| "type": "tool", | ||
| "name": tool_name, | ||
| }, | ||
| "tool_input": tool_input, | ||
| }, | ||
| ) | ||
| response.raise_for_status() | ||
|
|
||
| result = response.json() | ||
| if "error" in result: | ||
| return f"Error: {result['error']}" | ||
| return result.get("output", str(result)) |
Member
There was a problem hiding this comment.
Is there a reason for having an async method? I don't see it used in the class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
llama-index-tools-herokupackage for Heroku Agents API tool integration.Description
This integration enables LlamaIndex agents to execute SQL queries, run Python/JavaScript code, and interact with Heroku apps through the Heroku Agents API.
Features
HerokuToolSpecclass extending LlamaIndexBaseToolSpecrun_sql- Execute SQL queries on Heroku Postgresrun_python- Execute Python code in sandboxed environmentrun_javascript- Execute JavaScript code in sandboxed environmentget_app_info- Get Heroku app metadataReActAgentandFunctionCallingAgentUsage
Testing
Related
llama-index-llms-herokupackage🤖 Generated with Claude Code