Implement a new endpoint in the API that leverages a Language Model (LLM) to extract and structure onboarding data from user inputs. The endpoint should process unstructured text, generate structured data, and save it in the database.
Tasks:
API Endpoint Development:
Create a new API endpoint that accepts raw user input related to onboarding (e.g., location, capacity, installation date).
Ensure the endpoint interacts with the LLM API to process the input text and extract the relevant data.
Model Integration:
Integrate the selected Language Model (LLM) API into the system.
Pass user input text to the LLM API and retrieve the structured data response.
Ensure the API correctly interprets and extracts details such as location, capacity, and installation date.
Database Interaction:
Map the structured JSON data to the corresponding database fields.
Implement logic to save the extracted onboarding data into the database.
Ensure proper error handling in case of incomplete or ambiguous data, preventing database inconsistencies.
Testing and Validation:
Write unit tests to verify that the API endpoint correctly calls the LLM, structures data, and interacts with the database.
Perform integration tests to ensure the entire flow, from raw input to database storage, works seamlessly.
Handle edge cases where the LLM may fail to extract certain data or produce unexpected results.
Deliverables:
A fully functional API endpoint that processes onboarding-related user input and saves the extracted data into the database.
JSON schema for the structured data generated by the LLM.
Test coverage for the new functionality, ensuring robust error handling and integration success.
Objective:
Implement a new endpoint in the API that leverages a Language Model (LLM) to extract and structure onboarding data from user inputs. The endpoint should process unstructured text, generate structured data, and save it in the database.
Tasks:
API Endpoint Development:
Model Integration:
Database Interaction:
Testing and Validation:
Deliverables: