Skip to content

[Backend Registry] T02: Implement Enums & Model Struct #2

@leocamello

Description

@leocamello

Overview

Define BackendType, BackendStatus, DiscoverySource, and Model with serialization.

Estimated Time: 1.5 hours
Dependencies: #1 (T01)

Tests to Write First

#[test] fn test_backend_type_serialization()
#[test] fn test_backend_status_serialization()
#[test] fn test_discovery_source_serialization()
#[test] fn test_model_creation()
#[test] fn test_model_json_roundtrip()

Implementation Steps

  1. Write the 5 tests (they will fail - no impl yet)
  2. Implement enums with #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
  3. Use #[serde(rename_all = "lowercase")] for enum variants
  4. Implement Model struct with all fields from spec
  5. Run tests until all pass

Acceptance Criteria

  • All 5 tests pass
  • Enums serialize to lowercase strings
  • Model has all fields: id, name, context_length, supports_vision, supports_tools, supports_json_mode, max_output_tokens
  • cargo clippy passes

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0MVP Prioritybackend-registryBackend Registry featureenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions