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): relationships recommendation pipeline to produce the relationships for users easily establish #723

Merged
merged 10 commits into from
Oct 7, 2024

Conversation

paopa
Copy link
Member

@paopa paopa commented Oct 4, 2024

This PR introduces the RelationshipRecommendation service and corresponding router, which provide endpoints for generating and retrieving relationship recommendations based on Model Definition Language (MDL) input.

Important

This PR based on #716, thus before it to be merged, dont merge this PR. thanks!

Web API Specification

1. Generate Relationship Recommendation

Endpoint: POST /v1/relationship-recommendations

Request Body:

{
    "mdl": "{ ... }"  // JSON string of the MDL (Model Definition Language)
}

Response:

{
    "id": "unique-uuid"
}

2. Retrieve Relationship Recommendation

Endpoint: GET /v1/relationship-recommendations/{id}

Path Parameter:

  • id: Unique identifier of the relationship recommendation resource

Response:

{
   "id":"unique-uuid",
   "status":"generating", // "finished" "failed"
   "response":{
      "recommendations":[
         {
            "name":"name",
            "models":["model1", "model2"],
            "reason":"the reason why suggest this",
            "joinType":"ONE_TO_MANY",
            "condition":"..."
         }
      ]
   },
   "error":{
      "code":"OTHERS",
      "message":"Error description""failed"
   }
}

Usage

  1. Call the POST endpoint to initiate a relationship recommendation generation.
  2. Use the returned ID to poll the GET endpoint until the status is "finished" or "failed".
  3. Once finished, retrieve the generated recommendations from the "response" field.

Notes

  • The generation process is asynchronous and may take some time. Implement appropriate polling intervals when checking the status.
  • Error handling has been implemented to catch and report various exceptions that may occur during the process.

Screenshots

image image

@paopa paopa added module/ai-service ai-service related ci/ai-service ai-service related labels Oct 4, 2024
@paopa paopa force-pushed the feat/relationships-recommendation branch from eb2aed1 to ee9eb97 Compare October 4, 2024 10:13
@paopa paopa marked this pull request as ready for review October 4, 2024 10:17
@paopa paopa requested a review from cyyeh October 4, 2024 10:17
@paopa paopa changed the base branch from main to feat/semantics-description October 4, 2024 10:18
Copy link
Member

@cyyeh cyyeh left a comment

Choose a reason for hiding this comment

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

basically LGTM, thanks for hard work.

Base automatically changed from feat/semantics-description to main October 7, 2024 05:56
@paopa paopa force-pushed the feat/relationships-recommendation branch from ee9eb97 to c8ea912 Compare October 7, 2024 05:59
@cyyeh cyyeh merged commit d0d64c6 into main Oct 7, 2024
8 checks passed
@cyyeh cyyeh deleted the feat/relationships-recommendation branch October 7, 2024 06:05
AryanK1511 pushed a commit to AryanK1511/WrenAI that referenced this pull request Oct 7, 2024
…ce the relationships for users easily establish (Canner#723)

* prototype: relationships recommendation

* feat: modify some details about the pipeline

* chore: add pipeline config into multi llm config

* feat: implement service for relationships recommendation

* feat: impl api router for relationship recommendation

* chore: move the doc to the service class

* feat: test case for the relationship recommendation service

* feat: refactor the route and service design

* chore: update the test cases

* fix: wrong key to get the recommendation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/ai-service ai-service related module/ai-service ai-service related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants