Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor models.rs #275

Open
1 task
mdevino opened this issue Jan 9, 2025 · 0 comments
Open
1 task

Refactor models.rs #275

mdevino opened this issue Jan 9, 2025 · 0 comments

Comments

@mdevino
Copy link
Collaborator

mdevino commented Jan 9, 2025

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
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

No branches or pull requests

1 participant