Skip to content

Clean up request/response typesΒ #473

@declark1

Description

@declark1

Description

Update request/response type names to follow a consistent and improved naming scheme and ensure all endpoints have unique request types to enable implementation of a generic Task<R> type.

  • Update request/response types to follow a consistent naming scheme:
    • Use "response" instead of "result" in response type names
    • Use consistent verb tense, e.g. "streaming" instead of "stream"
    • Name should be based on endpoint name components, e.g. GuardrailsHttpRequest is too generic
    • We can omit "detection" for more concise names as it is redundant in this context (everything is detection)
    • Omit "http" and other unnecessary words such as "on" and "with" from names
    • Include modality in name if applicable, e.g. "text" (all endpoints except completions and chat completions)
  • Endpoints should have unique request types as this is cleaner and will enable us to use a generic Task<R> wrapper type for Handle implementations (to be implemented in separate issue) instead of separate task types for each endpoint
    • For endpoints that currently share the same request type, implement a newtype wrapper with a std::ops::Deref implementation
    • Reviewed this thread for ideas and think this is the best approach here (only needed for one endpoint currently)

Proposed names:

**DRAFT subject to change based on team feedback

Image

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