The current implementation in our system is tightly coupled with OpenAI's GPT models and a specific set of tools for car diagnostics. To improve our system's flexibility and facilitate local development/testing, we aim to generalize the API calls to be adaptable with any LLM.
Acceptance Criteria
Refactor LLM Interaction Code:
Abstract the LLM interaction logic into a separate module that can interface with any LLM, not just OpenAI's GPT.
Ensure that the new module can dynamically switch between LLMs based on configuration without changing the codebase.
Code Specific Guidance:
Module for Car Diagnostics: In get_context function, replace direct calls to ChatOpenAI and OpenAIEmbeddings with calls to the new abstracted LLM interaction module. Use environment variables or a configuration file to specify the LLM to be used.
Module to Interact with GPT Model: In prompt_chat_gpt function, ensure the model parameter can accept different LLM identifiers and that the LLM interaction module correctly interprets these identifiers.
Form Route Logic: Modify the submit_diagnostic function in the form handling module to use the abstracted LLM interaction module, allowing the local development environment to simulate the diagnostic process without relying on an external API.
Description:
The current implementation in our system is tightly coupled with OpenAI's GPT models and a specific set of tools for car diagnostics. To improve our system's flexibility and facilitate local development/testing, we aim to generalize the API calls to be adaptable with any LLM.
Acceptance Criteria
Code Specific Guidance:
get_contex
t function, replace direct calls toChatOpenAI
andOpenAIEmbeddings
with calls to the new abstracted LLM interaction module. Use environment variables or a configuration file to specify the LLM to be used.prompt_chat_gpt function
, ensure the model parameter can accept different LLM identifiers and that the LLM interaction module correctly interprets these identifiers.submit_diagnostic
function in the form handling module to use the abstracted LLM interaction module, allowing the local development environment to simulate the diagnostic process without relying on an external API.