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(wren-ai-service): Refactor Services to use Resource Classes #848

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Killer2OP
Copy link

Description

Refactored all the Services to use Resource Class

Fixes #736

@Killer2OP
Copy link
Author

@paopa @cyyeh Can you please review the PR :)

@paopa paopa self-requested a review November 4, 2024 06:58
@paopa
Copy link
Member

paopa commented Nov 5, 2024

Thank @Killer2OP for your hard work! I'll review this PR later today. It appears there are a few conflicts with the latest changes. Could you please resolve them?

Copy link
Member

@paopa paopa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution! I appreciate the effort you've put into this PR. I have a few remaining comments, and it appears that some tasks are still incomplete. Could you please replace the old classes (such as AskRequest, AskResponse, etc.) in the routers by the input and resource class?

Comment on lines +26 to +28
class Configurations(BaseModel):
fiscal_year: Optional[FiscalYear] = None
language: str = "English"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after solving the conflict for the latest commits, i think we could use Configuration class in web/v1/services module stead of it

Comment on lines +15 to +32
Dict[
"summary": str,
"sql": str,
"cte_name": str,
"corrections": List[
Dict[
"before": Dict[
"type": Literal["filter", "selectItems", "relation", "groupByKeys", "sortings"],
"value": str
],
"after": Dict[
"type": Literal["sql_expression", "nl_expression"],
"value": str
]
]
]
]
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this type declaration seems be wrong, could you help to fix? thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Dict[
"summary": str,
"sql": str,
"cte_name": str,
"corrections": List[
Dict[
"before": Dict[
"type": Literal["filter", "selectItems", "relation", "groupByKeys", "sortings"],
"value": str
],
"after": Dict[
"type": Literal["sql_expression", "nl_expression"],
"value": str
]
]
]
]
]
Dict[
"summary": str,
"sql": str,
"cte_name": str,
"corrections": list[dict]
]
]
]

Comment on lines +15 to +19
Dict[
"step_sql": str,
"step_summary": str,
"step_sql_analysis_results": List[Dict]
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gently ping to mention here has the same issue as the previous comment.

Comment on lines +21 to +23
configurations: Dict[
"language": str
] = {"language": "English"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gently ping to mention here has the same issue as the previous comment.

@Killer2OP
Copy link
Author

Thank you for your contribution! I appreciate the effort you've put into this PR. I have a few remaining comments, and it appears that some tasks are still incomplete. Could you please replace the old classes (such as AskRequest, AskResponse, etc.) in the routers by the input and resource class?

Sure, I will fix them.

@paopa
Copy link
Member

paopa commented Nov 11, 2024

hey @Killer2OP, hope everything is going smoothly. How's the progress on this PR? Let me know if you need any help. 😄

@Killer2OP
Copy link
Author

Killer2OP commented Nov 11, 2024

hey @Killer2OP, hope everything is going smoothly. How's the progress on this PR? Let me know if you need any help. 😄

Ya sure 😊 , I was busy due to the exam I will start working on it from today.

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

Successfully merging this pull request may close these issues.

Refactor Services to Use Resource Classes
2 participants