Skip to content

Refactor models.rs #275

Open
Open
@mdevino

Description

@mdevino

Description

As an orchestrator developer, I'd like to have an easier time when navigating through the code, so that I can develop faster.

Discussion

The models.rs file holds a lot of structs related to HTTP requests and responses. As we develop new endpoints, this file is only going to grow in size.

The code would be easier to navigate if we split these structs into different files. One option would be to split in files by endpoint. For example, the structs related to /api/v2/text/generation-detection are GenerationWithDetectionHttpRequest and GuardrailsTextGenerationParameters for the request, and GenerationWithDetectionResult and DetectionResult for the response. We could have these into a separate file. We would probably also need a file for structs used across multiple endpoints, such as GuardrailsTextGenerationParameters and DetectionResult.

I'm not entirely sure the suggestion above is the best approach, but I'm opening this issue so that we can kickstart the discussion.

Acceptance Criteria

  • Unit tests cover new/changed code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions