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

chore: new 'types' module #963

Conversation

alekst23
Copy link
Contributor

@alekst23 alekst23 commented Aug 28, 2024

Description

We need a better way to organize our type definitions. Currently we have the following issues:

  • One file with a lot of definitions: src/leapfrogai_api/backend/types.py. Very long file with many types for different purposes defined together. Difficult to analyze and find code.
  • Some types mix data models and complex function implementations in one class
  • Types are not defined in a consistent manner

Good format to follow is the OpenAI types module:
https://github.com/openai/openai-python/tree/main/src/openai/types

BREAKING CHANGES

All changes to type definitions should be applied to all relevant files as part of the PR.

CHANGES

  • A new module for leapfrogai_api is created: types.
  • Python Module format allows for complex type hierarchy and selective importing of objects.
  • Creates a standardized way for application to define and use types.
  • Consolidates types defined inline and in src/leapfrogai_api/backend/types to the new types module
  • Consolidates constants to src/leapfrogai_api/types/constants.py

Related Issue

Precursor to:
#948

Checklist before merging

@alekst23 alekst23 linked an issue Aug 28, 2024 that may be closed by this pull request
Copy link

netlify bot commented Aug 28, 2024

Deploy Preview for leapfrogai-docs ready!

Name Link
🔨 Latest commit 31354be
🔍 Latest deploy log https://app.netlify.com/sites/leapfrogai-docs/deploys/66df102eca70d80008c6b766
😎 Deploy Preview https://deploy-preview-963--leapfrogai-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 40 (🟢 up 17 from production)
Accessibility: 98 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@alekst23 alekst23 added the chore label Aug 29, 2024
@alekst23 alekst23 self-assigned this Sep 4, 2024
@alekst23 alekst23 marked this pull request as ready for review September 4, 2024 16:40
@alekst23 alekst23 requested a review from a team as a code owner September 4, 2024 16:40
@alekst23 alekst23 marked this pull request as draft September 4, 2024 17:44
@alekst23 alekst23 force-pushed the 774-choreapi-move-request-types-and-validation-into-routersrequests branch from b8c2b4a to ad14690 Compare September 4, 2024 18:24
@alekst23 alekst23 changed the title chore: New 'types' module chore: new 'types' module Sep 4, 2024
@alekst23 alekst23 marked this pull request as ready for review September 4, 2024 18:53
@alekst23 alekst23 marked this pull request as draft September 4, 2024 21:20
@alekst23 alekst23 force-pushed the 774-choreapi-move-request-types-and-validation-into-routersrequests branch from e5cf51b to 8bbdf1a Compare September 5, 2024 14:29
@alekst23 alekst23 marked this pull request as ready for review September 5, 2024 14:29
…830)

* Enables Supabase realtime for the vector_store_file table
* Adds new Python dependency to test supabase-realtime
* Status is currently being set during indexing so listening to this table should provide status updates on the file indexing process.
@alekst23 alekst23 closed this Sep 9, 2024
@alekst23 alekst23 mentioned this pull request Sep 9, 2024
2 tasks
@justinthelaw justinthelaw deleted the 774-choreapi-move-request-types-and-validation-into-routersrequests branch September 25, 2024 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants