deepu_07113
11/03/2025, 11:26 AMVaibhav (BAML 🐑)
11/03/2025, 2:22 PMpdf type!Vaibhav (BAML 🐑)
11/03/2025, 2:22 PMdeepu_07113
11/03/2025, 3:21 PMdeepu_07113
11/03/2025, 3:21 PMdeepu_07113
11/03/2025, 3:23 PMdeepu_07113
11/03/2025, 3:23 PMdeepu_07113
11/03/2025, 3:23 PMdeepu_07113
11/03/2025, 3:24 PMVaibhav (BAML 🐑)
11/03/2025, 5:22 PMVaibhav (BAML 🐑)
11/03/2025, 5:22 PMdeepu_07113
11/04/2025, 6:32 AMVaibhav (BAML 🐑)
11/04/2025, 6:32 AMdeepu_07113
11/04/2025, 6:33 AMdeepu_07113
11/04/2025, 6:33 AMdeepu_07113
11/04/2025, 6:34 AMdeepu_07113
11/04/2025, 6:35 AMVaibhav (BAML 🐑)
11/04/2025, 6:35 AMdeepu_07113
11/04/2025, 10:59 AMdeepu_07113
11/04/2025, 11:00 AMdeepu_07113
11/04/2025, 11:03 AMVaibhav (BAML 🐑)
11/04/2025, 12:47 PMdeepu_07113
11/04/2025, 1:31 PMVaibhav (BAML 🐑)
11/04/2025, 1:32 PMdeepu_07113
11/04/2025, 1:32 PMVaibhav (BAML 🐑)
11/04/2025, 1:33 PMVaibhav (BAML 🐑)
11/04/2025, 1:34 PMinput variable in your prompt. but only mypdf exists.Vaibhav (BAML 🐑)
11/04/2025, 1:34 PMVaibhav (BAML 🐑)
11/04/2025, 1:34 PMdeepu_07113
11/04/2025, 1:35 PMdeepu_07113
11/04/2025, 1:46 PMdeepu_07113
11/04/2025, 1:46 PM---REQUEST OPTIONS---
model: "llama3"
---ERROR (Unspecified error code: 400)---
Request failed with status code: 400 Bad Request. {"error":{"message":"invalid message format","type":"invalid_request_error","param":null,"code":null}}
Traceback (most recent call last):
File "C:\baml\baml-neo4j\src\01_Extract_Market_Highlights.py", line 32, in <module>
extract_pdf_content(filepath)
File "C:\baml\baml-neo4j\src\01_Extract_Market_Highlights.py", line 26, in extract_pdf_content
res1 = b.ExtractMarketHighlightsInfo(base64in)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\baml\baml-neo4j\src\baml_client\sync_client.py", line 135, in ExtractMarketHighlightsInfo
return typing.cast(types.MarketHighlightsInfo, result.cast_to(types, types, stream_types, False, __runtime__))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
baml_py.internal_monkeypatch.BamlClientHttpError: BamlClientHttpError(client_name=OllamaLlama3, message=Request failed with status code: 400 Bad Request. {"error":{"message":"invalid message format","type":"invalid_request_error","param":null,"code":null}}, status_code=400, detailed_message=LLM client "OllamaLlama3" failed with status code: Unspecified error code: 400
Message: Request failed with status code: 400 Bad Request. {"error":{"message":"invalid message format","type":"invalid_request_error","param":null,"code":null}})Vaibhav (BAML 🐑)
11/04/2025, 1:47 PMdeepu_07113
11/04/2025, 1:47 PMVaibhav (BAML 🐑)
11/04/2025, 1:48 PMVaibhav (BAML 🐑)
11/04/2025, 1:48 PMVaibhav (BAML 🐑)
11/04/2025, 1:48 PMdeepu_07113
11/04/2025, 1:50 PMVaibhav (BAML 🐑)
11/04/2025, 1:53 PMpython
from pdf2image import convert_from_bytes
from PIL import Image as PILImage
from baml_py import Image
def convert_to_base64(img: PILImage):
buffered = io.BytesIO()
img.save(buffered, format="JPEG")
return Image.from_base64(base64=base64.b64encode(buffered.getvalue()).decode("utf-8"), media_type="image/jpeg")
file_content = await file.read()
images = convert_from_bytes(file_content)
baml_images = [convert_to_base64(img) for img in images]Vaibhav (BAML 🐑)
11/04/2025, 1:53 PMimage[] instead of pdf type into your functiondeepu_07113
11/04/2025, 1:54 PMVaibhav (BAML 🐑)
11/04/2025, 1:54 PMdeepu_07113
11/04/2025, 1:54 PMVaibhav (BAML 🐑)
11/04/2025, 1:54 PMVaibhav (BAML 🐑)
11/04/2025, 1:55 PMVaibhav (BAML 🐑)
11/04/2025, 1:55 PMdeepu_07113
11/04/2025, 1:56 PMdeepu_07113
11/04/2025, 1:57 PMdeepu_07113
11/04/2025, 1:58 PMVaibhav (BAML 🐑)
11/04/2025, 1:59 PMdeepu_07113
11/04/2025, 1:59 PMVaibhav (BAML 🐑)
11/04/2025, 1:59 PMdeepu_07113
11/05/2025, 10:37 AMVaibhav (BAML 🐑)
11/05/2025, 12:40 PMVaibhav (BAML 🐑)
11/05/2025, 12:41 PM