Skip to content

Conversation

brijsiyag-meesho
Copy link

@brijsiyag-meesho brijsiyag-meesho commented Sep 21, 2025

Add DR_CUSTOM_TOOL_USE_LLM_SUMMARY config to control whether custom tool responses are summarized by LLM in DR agent. Defaults to true for backward compatibility. Set to false to return raw tool results directly.

Description

In my case, I wanted the response of tool directly without being altered by LLM so put this logic behind a flag

How Has This Been Tested?

Manual Testing

Backporting (check the box to trigger backport action)

Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

Summary by cubic

Make LLM summarization of DR custom tool outputs configurable. Default behavior stays the same; set DR_CUSTOM_TOOL_USE_LLM_SUMMARY=false to return raw tool results (JSON is pretty-printed).

  • New Features
    • Added DR_CUSTOM_TOOL_USE_LLM_SUMMARY env var and wired it into GraphTooling and chat answer init.
    • Updated custom_tool_act to conditionally use LLM; when disabled, return the raw tool output with JSON pretty-printing.

Add DR_CUSTOM_TOOL_USE_LLM_SUMMARY config to control whether custom tool
responses are summarized by LLM in DR agent. Defaults to true for backward
compatibility. Set to false to return raw tool results directly.
@brijsiyag-meesho brijsiyag-meesho requested a review from a team as a code owner September 21, 2025 21:15
Copy link

vercel bot commented Sep 21, 2025

@brijsiyag-meesho is attempting to deploy a commit to the Danswer Team on Vercel.

A member of the Team first needs to authorize it.

@brijsiyag-meesho brijsiyag-meesho changed the title feat: add configurable LLM summarization for DR custom tools config: add configurable LLM summarization for DR custom tools Sep 21, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR introduces a new configuration flag DR_CUSTOM_TOOL_USE_LLM_SUMMARY to provide users with control over how custom tool responses are processed in the DR (Deep Research) agent. By default, the system currently sends all custom tool responses through an LLM for summarization before returning them to users. This change adds an environment variable-controlled flag that allows users to bypass this LLM processing and receive raw, unmodified tool responses instead.

The implementation follows established patterns in the codebase by:

  1. Adding the configuration in tool_configs.py with proper boolean parsing from environment variables
  2. Threading the config through the system via GraphTooling model in models.py
  3. Importing and wiring it in answer.py to pass the setting to the graph configuration
  4. Implementing the conditional logic in the DR custom tool agent (dr_custom_tool_2_act.py)

The flag defaults to true for backward compatibility, maintaining existing behavior for current deployments. When set to false, the system returns raw tool results directly, with additional JSON pretty-printing for improved readability when dealing with JSON responses. This change integrates seamlessly with the existing custom tool infrastructure that was already established for handling OpenAPI-based tools and various response types (JSON, CSV, images).

Confidence score: 5/5

  • This PR is safe to merge with minimal risk as it's a simple configuration flag with sensible defaults
  • Score reflects straightforward implementation following established patterns with proper fallback handling
  • No files require special attention - all changes are standard configuration additions

4 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

@brijsiyag-meesho brijsiyag-meesho changed the title config: add configurable LLM summarization for DR custom tools feat: add configurable LLM summarization for DR custom tools Sep 21, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant