Renovus-Tech / solarec-python

GNU Affero General Public License v3.0
0 stars 0 forks source link

Q4 Milestone 3 - Use LLM to automatically extract data for client onboarding - Phase 4: Model Integration #28

Closed matildemaccio closed 2 months ago

matildemaccio commented 2 months ago

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:

  1. 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.
  2. 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.
  3. 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.
  4. 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: