Implement Tool Use for Dynamic Template and Guideline Selection in format_text
#24
Labels
enhancement
New feature or request
format_text
#24
Summary:
This issue proposes to enhance the
format_text
function in the VoxRad application by leveraging the tool use capabilities of LLMs. Currently, theformat_text
function requires user to select a template which is then used to structure the transcript. But LLM can be leveraged to select a template automatically if no user-selected template is available, and also can generate recommendations, if required. This enhancement will integrate tool use to make template selection and recommendation generation in a robust, dynamic, and context-aware manner.Background:
The
format_text
function is responsible for formatting transcribed radiology reports using a user-selected chosen template. Currently, if no template is selected by the user, the LLM goes ahead and structures the report according to the instructions in system prompt. The application capability can be extended using function calling to analyse the transcript and select template (from files intemplate
folder) for creating a structured report and later further analyse the structured report and fetch relevant guidelines (from files inguidelines
folder) and generate recommendations required for the structured report. The objective is to improve this by introducing more refined, controlled, and dynamic functionality for template and guideline selection based on transcription content.Proposed Enhancement:
Dynamic Template Selection:
format_text
should continue to use function calling to intelligently select the most suitable template from the "templates" directory (e.g., by analyzing the transcript content and available templates)._select_template
function to be implemented to use the tool.Intelligent Guideline Selection and Recommendation Generation:
_analyze_recommendation_needs
)._generate_recommendations
and_validate_guidelines
can be implemented for this step.Tool Use Implementation:
_select_template
,_analyze_recommendation_needs
, and_generate_recommendations
) to be created to use function calling, which is essentially a form of tool use. This enhancement will simply integrate this more clearly and dynamically.format_text
and the existing helper functions.Benefits:
Implementation Details:
format_text
function to integrate the_select_template
,_analyze_recommendation_needs
, and_generate_recommendations
in a sequence using tool use, creating better control and dynamic output._validate_guidelines
is incorporated to not break when guidelines are updated or removed.Acceptance Criteria:
format_text
uses tool use to intelligently select report templates when no user selected template is present.format_text
intelligently determines if recommendations are needed, and if yes, it uses tool use to select appropriate guidelines.The text was updated successfully, but these errors were encountered: