Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
hi @mattzcarey ,I am having some problems with deepseek.
I get the response data, but I get an error when I use parseJson.
DEBUG Unparsed JSON
json { "fileName": "/Users/wchenonly/work/gitHub/f/code-review-gpt/src/common/model/AIModel.ts", "riskScore": 2, "feedbackDetails": "1. The `temperature` parameter in `createDeepSeekModel` is being destructured with a default value of `0.0`, but this default value is not documented or explained. This could lead to confusion or unintended behavior if the default is not appropriate for all use cases. Consider adding a comment or documentation to clarify the default value.\n\n2. The `callStructuredModel` method in `createDeepSeekModel` does not handle potential errors during JSON parsing. If the API response is malformed, this could lead to runtime errors. Consider wrapping the `parseJson` call in a try-catch block to handle such cases gracefully.\n\n
typescript\ncallStructuredModel: async (prompt: string): Promise<IFeedback[]> => {\n try {\n const completion = await client.chat.completions.create({\n messages: [{ role: 'user', content: prompt }],\n model,\n temperature,\n });\n const content = completion.choices[0].message.content;\n return parseJson(content as string);\n } catch (error) {\n logger.error('Failed to parse JSON response', error);\n throw new Error('Failed to parse JSON response');\n }\n},\n```"}