Skip to content

Commit f179fa4

Browse files
committed
fix
1 parent 66b8f82 commit f179fa4

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

libs/core/langchain_core/language_models/_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ def _convert_openai_format_to_data_block(block: dict) -> dict:
9292

9393
if block["type"] == "input_audio":
9494
data = block["input_audio"].get("data")
95-
format = block["input_audio"].get("format")
96-
if data and format:
95+
audio_format = block["input_audio"].get("format")
96+
if data and audio_format:
9797
return {
9898
"type": "audio",
9999
"source_type": "base64",
100100
"data": data,
101-
"mime_type": f"audio/{format}",
101+
"mime_type": f"audio/{audio_format}",
102102
}
103103
return block
104104

libs/core/langchain_core/messages/content_blocks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ def convert_to_openai_data_block(block: dict) -> dict:
140140

141141
elif block["type"] == "audio":
142142
if block["source_type"] == "base64":
143-
format = block["mime_type"].split("/")[-1]
143+
audio_format = block["mime_type"].split("/")[-1]
144144
formatted_block = {
145145
"type": "input_audio",
146-
"input_audio": {"data": block["data"], "format": format},
146+
"input_audio": {"data": block["data"], "format": audio_format},
147147
}
148148
else:
149149
error_msg = "source_type base64 is required for audio blocks."

libs/core/langchain_core/prompts/dict.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
from functools import cached_property
55
from typing import Any, Literal, Optional
66

7+
from typing_extensions import override
8+
79
from langchain_core.load import dumpd
810
from langchain_core.prompts.string import (
911
DEFAULT_FORMATTER_MAPPING,
@@ -36,6 +38,7 @@ async def aformat(self, **kwargs: Any) -> dict[str, Any]:
3638
"""Format the prompt with the inputs."""
3739
return self.format(**kwargs)
3840

41+
@override
3942
def invoke(
4043
self, input: dict, config: Optional[RunnableConfig] = None, **kwargs: Any
4144
) -> dict:

libs/core/uv.lock

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)