feedback package

Submodules

feedback.feedback_judge module

class feedback.feedback_judge.FeedbackJudge(api_key, api_base_url, model_name, org_id, prompt_templates, **model_kwargs)[source]

Bases: MultiModalModel

is_design_goal_achieved(feedback: str, design_goal: str) Tuple[bool, float][source]

Determine if the design goal has been achieved and provide a score based on the Hits.

Parameters:
  • feedback – The feedback to process.

  • design_goal – The design goal to compare against.

Returns:

A tuple containing a boolean indicating if the goal is achieved and a score between 0 and 1.

feedback.feedback_judge.parse_args() Dict[str, Any][source]

Parse command line arguments.

Returns:

Parsed arguments.

Return type:

Dict[str, Any]

feedback.visual_feedback module

class feedback.visual_feedback.VisualFeedback(api_key, api_base_url, model_name, org_id, prompt_templates, **model_kwargs)[source]

Bases: MultiModalModel

generate_feedback_paragraph(design_goal: str, reference_images: List[str] | None, rendered_images: List[str]) str[source]

Generate a feedback paragraph comparing the rendered object with the design goal and reference images. Focus on geometry, shape, and physical feasibility.

Parameters:
  • design_goal – Text description of the design specifications.

  • reference_images – List of byte data for reference images.

  • rendered_images – List of byte data for rendered object images.

Returns:

A paragraph of feedback highlighting hits and misses.

feedback.visual_feedback.parse_args() Dict[str, Any][source]

Parse command line arguments.

Returns:

Parsed arguments.

Return type:

Dict[str, Any]

feedback.visual_qa module

class feedback.visual_qa.VisualQA(api_key, api_base_url, model_name, org_id, prompt_templates, **model_kwargs)[source]

Bases: MultiModalModel

automated_qa(design_goal: str, reference_images: List[str] | None, rendered_images: List[str], num_questions: int = 5) dict[source]

Generate questions and then generate answers to those questions.

Parameters:
  • design_goal (str) – Text description of the design goal.

  • reference_images (List[str]) – List of reference images in str.

  • rendered_images (List[str]) – List of rendered images in str.

  • num_questions (int) – Number of questions to generate.

Returns:

Dictionary containing the generated questions and answers.

Return type:

dict

generate_answers(design_goal: str, questions: List[str], reference_images: List[str] | None, rendered_images: List[str]) dict[source]

Generate answers to the provided questions based on the design goal and images.

Parameters:
  • design_goal (str) – Text description of the design goal.

  • questions (List[str]) – List of questions to answer.

  • reference_images (List[str]) – List of reference images in str.

  • rendered_images (List[str]) – List of rendered images in str.

Returns:

Dictionary of questions and their corresponding answers.

Return type:

dict

generate_questions(design_goal: str, reference_images: List[str] | None, num_questions: int = 5) List[str][source]

Generate questions based on the design goal and images. :param design_goal: Text description of the design goal. :type design_goal: str :param reference_images: List of reference images paths. :type reference_images: List[str] :param num_questions: Number of questions to generate. :type num_questions: int

Returns:

List of generated questions.

Return type:

List[str]

feedback.visual_qa.load_images(path: str) List[str][source]

Load images from a folder and convert them to base64.

Parameters:

path (str) – Path to the folder containing images.

Returns:

List of images in base64 format.

Return type:

List[bytes]

Module contents