Open KTS-o7 opened 1 week ago
FYI - the patient and the evaluator data is already fetched from the database here. If you plan to refactor the code for the openai utility then you need to make code changes at few places as it will affect the current flow.
Although the plan of getting structured output from openAi looks good to me. Please proceed with the above plan. Just a heads up before you make any changes - the output that it will generate is not consumable by the current implementation. You may need to change the schema for Evaluation and coordinate with @sufiyanas to adapt these changes on the client side.
I noticed that this method needs too many changes. So for now I will first add a new structured output function to the openai file. Later on we need to see what and all types of outputs are needed
I noticed that this method needs too many changes. So for now I will first add a new structured output function to the openai file. Later on we need to see what and all types of outputs are needed
Sure, sounds good to me.
@krishna9304 This is just a rough plans on how to pass and get evals. Needs more work. Guide me from ur pov too please.
Like pydantic in python, we directly pass a Json Schema in typescript ig
Description
We need to extend the current functionality to extract patient and evaluator information in order to make good requests and get great responses from OpenAI. The current system and user prompts need to be updated to fit this purpose.
Current Functionality
The current functionality to send structured JSON schema requests to OpenAI is located in
src/utils/openai.util.ts
. Here is the relevant part of the code:Task Details
Create JSON Schema:
Define a JSON schema similar to the example provided:
Update
openai.util.ts
:Modify the methods to include the JSON schema:
Extract Patient and Evaluator Data:
openai.util.ts
utility.Example Code to Extract Data and Send Request:
References