Community: fix missing f-string modifier in oai structured output parsing error (#29326)

- **Description:** The ValueError raised on certain structured-outputs
parsing errors, in langchain openai community integration, was missing a
f-string modifier and so didn't produce useful outputs. This is a
2-line, 2-character change.
- **Issue:** None open that this fixes
- **Dependencies:** Nothing changed
- **Twitter handle:** None

- [X] **Add tests and docs**: There's nothing to add for.
- [-] **Lint and test**: Happy to run this if you deem it necessary.

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
This commit is contained in:
Hugo Berg 2025-01-21 15:26:38 +01:00 committed by GitHub
parent 566915d7cf
commit 32c9c58adf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2486,7 +2486,7 @@ def _oai_structured_outputs_parser(ai_msg: AIMessage) -> PydanticBaseModel:
else:
raise ValueError(
"Structured Output response does not have a 'parsed' field nor a 'refusal' "
"field. Received message:\n\n{ai_msg}"
f"field. Received message:\n\n{ai_msg}"
)