Figure description endpoint not receiving parameters correctly #8058

Open
opened 2026-02-16 18:09:02 -05:00 by yindo · 0 comments
Owner

Originally created by @slikak on GitHub (Jan 30, 2026).

Originally assigned to: @rekram1-node on GitHub.

Problem Description

The figure description endpoint is not receiving parameters correctly from the request body despite them appearing properly in Swagger/OpenAPI documentation.

Expected Parameters (as per documentation):

  • context → string
  • image → file (JPEG binary)
  • generation_language → string
  • patent_office → string
  • invention_type → string
  • description_style → string
  • caption_style → string
  • technical_field → string
  • figure_description_parameters → string (JSON-encoded object)

Current Issue

While the parameters appear in Swagger UI and are defined in the request body, they are not being correctly accessed by the LLM prompt, leading to inaccurate descriptions.

What I did today:

  1. Verified that the description prompt is being called correctly
  2. Confirmed that the endpoint accepts all expected parameters in the request body
  3. Identified that the schema definition in doesn't match the full set of parameters being expected

Root Cause Analysis

Looking at the current implementation:

  1. The route handler defines all expected parameters correctly
  2. The schema only includes limited fields (section_name, file_type, figure_description)
  3. The service is correctly accessing attributes using getattr() fallback, but parameters are not being properly passed through from the request body

Files involved:

  • ai-engine/src/api/v1/routes/figures.py
  • ai-engine/src/api/v1/schemas/figure_schemas.py
  • ai-engine/src/services/figure_service.py

Current Status

The image upload and basic parameters work, but advanced parameters (patent_office, invention_type, etc.) are not being properly utilized in the LLM prompt generation.

Originally created by @slikak on GitHub (Jan 30, 2026). Originally assigned to: @rekram1-node on GitHub. ## Problem Description The figure description endpoint is not receiving parameters correctly from the request body despite them appearing properly in Swagger/OpenAPI documentation. ## Expected Parameters (as per documentation): - context → string - image → file (JPEG binary) - generation_language → string - patent_office → string - invention_type → string - description_style → string - caption_style → string - technical_field → string - figure_description_parameters → string (JSON-encoded object) ## Current Issue While the parameters appear in Swagger UI and are defined in the request body, they are not being correctly accessed by the LLM prompt, leading to inaccurate descriptions. ## What I did today: 1. Verified that the description prompt is being called correctly 2. Confirmed that the endpoint accepts all expected parameters in the request body 3. Identified that the schema definition in doesn't match the full set of parameters being expected ## Root Cause Analysis Looking at the current implementation: 1. The route handler defines all expected parameters correctly 2. The schema only includes limited fields (section_name, file_type, figure_description) 3. The service is correctly accessing attributes using getattr() fallback, but parameters are not being properly passed through from the request body ## Files involved: - ai-engine/src/api/v1/routes/figures.py - ai-engine/src/api/v1/schemas/figure_schemas.py - ai-engine/src/services/figure_service.py ## Current Status The image upload and basic parameters work, but advanced parameters (patent_office, invention_type, etc.) are not being properly utilized in the LLM prompt generation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8058