Skip to content

Commit

Permalink
merge: master
Browse files Browse the repository at this point in the history
  • Loading branch information
rkwan05 committed Nov 26, 2024
1 parent 196a766 commit d2f8a28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libs/core/langchain_core/prompts/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@


# extract pdf into bytes
def extract_pdf_text(pdf_data: bytes) -> str:
def extract_pdf_text(pdf_data: str) -> str:
# Decode the base64 back into bytes
pdf_bytes = base64.b64decode(pdf_data)
pdf_text = ""
Expand Down Expand Up @@ -488,7 +488,7 @@ class _ImageTemplateParam(TypedDict, total=False):


class _PdfTemplateParam(TypedDict, total=False):
pdf: Union[str, dict]
data: str


class _StringImageMessagePromptTemplate(BaseMessagePromptTemplate):
Expand Down
4 changes: 2 additions & 2 deletions libs/core/tests/unit_tests/prompts/test_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from tests.unit_tests.pydantic_utils import _normalize_schema


def test_create_pdf_chat_prompt() -> None:
def test_create_chat_prompt_template() -> None:
"""Test chat prompt with pdf data as bytes."""
file_path = (
Path(__file__).parent.parent.parent.parent.parent
Expand All @@ -59,7 +59,7 @@ def test_create_pdf_chat_prompt() -> None:
]
)

expected_prompt = PromptTemplate(template="Hello world!\n1\n")
expected_prompt = PromptTemplate(template="Hello world!\n1\n", input_variables=[])

assert len(prompt.messages) == 1
output_prompt = prompt.messages[0]
Expand Down

0 comments on commit d2f8a28

Please sign in to comment.