Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hold "warning" filed when test in deprecated model like "text-davinci-003" #66

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

wangmiao-1981
Copy link
Contributor

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"])

the default completion model "text-davinci-003" is deprecated, warning field appeared unexpected.

{
  "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",
@HamaWhiteGG
Copy link
Owner

Thank you for your contribution. The description was very detailed.

Next time, could you remember to merge it into the 'dev' branch, Thanks.

@HamaWhiteGG HamaWhiteGG merged commit fd74c51 into HamaWhiteGG:main Aug 4, 2023
1 check passed
@mcheung610
Copy link

Can we fix the object mapper so it will ignore unknown fields by default?

@HamaWhiteGG
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants