Closed wangmiao-1981 closed 1 year ago
Thank you for your contribution. The description was very detailed.
Next time, could you remember to merge it into the 'dev' branch, Thanks.
Can we fix the object mapper so it will ignore unknown fields by default?
Can we fix the object mapper so it will ignore unknown fields by default?
Good idea. I add objectMapper.configure(FAIL_ON_UNKNOWN_PROPERTIES, false) for OpenAiClient to ignore unknown fields, for example the warning field.
the default completion model "text-davinci-003" is deprecated, a warning field appeared unexpected when run LLMChainTest.testLLMChainWithOneInputVariables.
resp looks like: { "warning": "This model version is deprecated. Migrate before January 4, 2024 to avoid disruption of service. Learn more https://platform.openai.com/docs/deprecations", "id": "cmpl-7jTUpXmJZSjbeWtljF6NykqeQMIYo", "object": "text_completion", "created": 1691072499, "model": "text-davinci-003", ... }
the crash report looks like: java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "warning" (class com.hw.openai.entity.completions.CompletionResp), not marked as ignorable (6 known properties: "usage", "choices", "created", "model", "id", "object"])