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

feat(wren-ai-service): refactored API Endpoints into Independent Routers #747

Merged
merged 15 commits into from
Oct 21, 2024

Conversation

Spirizeon
Copy link
Contributor

This PR fixes the issue of #735 (Work In Progress)

@Spirizeon Spirizeon changed the title Refactored API Endpoints into Independent Routers feat(wren-ai-service): Refactored API Endpoints into Independent Routers Oct 13, 2024
@Spirizeon Spirizeon changed the title feat(wren-ai-service): Refactored API Endpoints into Independent Routers feat(wren-ai-service): refactored API Endpoints into Independent Routers Oct 13, 2024
@Spirizeon Spirizeon marked this pull request as ready for review October 13, 2024 18:58
@Spirizeon
Copy link
Contributor Author

Spirizeon commented Oct 13, 2024

@paopa thanks for letting me work on the issue,
please review and lemme know if any changes are needed.

@cyyeh cyyeh requested a review from paopa October 14, 2024 02:20
@paopa paopa linked an issue Oct 14, 2024 that may be closed by this pull request
@paopa
Copy link
Member

paopa commented Oct 14, 2024

@paopa thanks for letting me work on the issue, please review and lemme know if any changes are needed.

Thanks for the hard work again! I will review it in these day!

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.

Thanks for the work first!. overall it is good to me. I think having a few comments need to be done, then we can merge this PR. the router document you can refer to

1. POST /semantics-descriptions
- Generates a new semantic description
- Request body: PostRequest
{
"selected_models": ["model1", "model2"], # List of model names to describe
"user_prompt": "Describe these models", # User's instruction for description
"mdl": "{ ... }" # JSON string of the MDL (Model Definition Language)
}
- Response: PostResponse
{
"id": "unique-uuid" # Unique identifier for the generated description
}
2. GET /semantics-descriptions/{id}
- Retrieves the status and result of a semantic description generation
- Path parameter: id (str)
- Response: GetResponse
{
"id": "unique-uuid", # Unique identifier of the description
"status": "generating" | "finished" | "failed",
"response": { # Present only if status is "finished"
"model1": {
"name": "model1",
"columns": [
{
"name": "col1",
"description": "Unique identifier for each record in the example model."
}
],
"description": "This model is used for analysis purposes, capturing key attributes of records."
},
"model2": {
"name": "model2",
"columns": [
{
"name": "col1",
"description": "Unique identifier for each record in the example model."
}
],
"description": "This model is used for analysis purposes, capturing key attributes of records."
}
},
"error": { # Present only if status is "failed"
"code": "OTHERS",
"message": "Error description"
}
}

wren-ai-service/src/web/v1/routers/__init__.py Outdated Show resolved Hide resolved
wren-ai-service/src/web/v1/routers/ask_details.py Outdated Show resolved Hide resolved
wren-ai-service/src/web/v1/routers/asking.py Outdated Show resolved Hide resolved
wren-ai-service/src/web/v1/routers/ask_details.py Outdated Show resolved Hide resolved
wren-ai-service/src/web/v1/routers/asking.py Outdated Show resolved Hide resolved
wren-ai-service/src/web/v1/routers/sql_answers.py Outdated Show resolved Hide resolved
wren-ai-service/src/web/v1/routers/sql_expansions.py Outdated Show resolved Hide resolved
wren-ai-service/src/web/v1/routers/sql_explanations.py Outdated Show resolved Hide resolved
wren-ai-service/src/web/v1/routers/sql_regenerations.py Outdated Show resolved Hide resolved
@Spirizeon
Copy link
Contributor Author

Spirizeon commented Oct 18, 2024

Thanks for the work first!. overall it is good to me. I think having a few comments need to be done, then we can merge this PR. the router document you can refer to

1. POST /semantics-descriptions
- Generates a new semantic description
- Request body: PostRequest
{
"selected_models": ["model1", "model2"], # List of model names to describe
"user_prompt": "Describe these models", # User's instruction for description
"mdl": "{ ... }" # JSON string of the MDL (Model Definition Language)
}
- Response: PostResponse
{
"id": "unique-uuid" # Unique identifier for the generated description
}
2. GET /semantics-descriptions/{id}
- Retrieves the status and result of a semantic description generation
- Path parameter: id (str)
- Response: GetResponse
{
"id": "unique-uuid", # Unique identifier of the description
"status": "generating" | "finished" | "failed",
"response": { # Present only if status is "finished"
"model1": {
"name": "model1",
"columns": [
{
"name": "col1",
"description": "Unique identifier for each record in the example model."
}
],
"description": "This model is used for analysis purposes, capturing key attributes of records."
},
"model2": {
"name": "model2",
"columns": [
{
"name": "col1",
"description": "Unique identifier for each record in the example model."
}
],
"description": "This model is used for analysis purposes, capturing key attributes of records."
}
},
"error": { # Present only if status is "failed"
"code": "OTHERS",
"message": "Error description"
}
}

@paopa Thank you for the suggestions! If you can kindly review the changes now.

@paopa paopa self-requested a review October 21, 2024 02:20
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.

LGTM! kudos to your hard work!

@paopa paopa merged commit 6c79291 into Canner:main Oct 21, 2024
5 checks passed
@paopa
Copy link
Member

paopa commented Oct 21, 2024

hey @Spirizeon, Thanks for the contribution again! You can DM @chilijung on Discord with #735 to get the swag form link.

@Spirizeon Spirizeon deleted the refactor/endpoints branch October 22, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor API Endpoints into Independent Routers
2 participants