https://www.boundaryml.com logo
baml files and chain of thought
# general
i
Hello Baml team, I am currently working on a project that receives flat files as input (DOCX/ PDF / CSV / XSLX) and then uses a BAML function to extract / generate an output from them for downstream processing. Here is what I have set up so far: 1. An output Baml class 2. Baml function with (using Azure GPT5 deployment) I would like some guidance on how I can achieve the following: 1. How can I directly ingest the file into the LLMs context as an input argument for my baml function? 2. How can I stream the chain of thoughts from the LLM while its inferencing ?
b
Hi there! ๐Ÿ‘‹
To stream chain of thought, there are two options:
1- add a separate json field for chain-of-thought
and then listen on streamed values to that value
2- use the collector API to grab the underlying LLM response body
For the files, itโ€™s less simple:
PDFs you can pass through directly (we have a pdf type) CSVs you can just inline as text DOCX/XLSX are zip files that you have to re-encode yourself
i
Will using the collector API work with provider azure-openai?
b
In particular for docx/xlsx most model providers donโ€™t accept those as input
The collector API works with every provider!
i
Awesome will give these a shot, thank you!
Hey sam just had a another question regarding working with Azure's OpenAI Responses API: https://learn.microsoft.com/en-us/azure/ai-foundry/openai/how-to/responses?tabs=python-key Just wanted to clarify if there is still a limitation of using this api when setting up my Azure client as follows:
Copy code
client<llm> AzureGPT5 {
  provider azure-openai
  options {
    resource_name "redacted"
    deployment_id "gpt5"
    api_version "redacted"
    api_key redacted
    max_tokens null
  }
}
I am using baml 0.84.4
b
Sorry, completely missed this! 0.84.4 predates the openai-responses API, so it definitely won't work ๐Ÿ™‚
I don't think we've made azure-openai support openai-responses though, so we probably have to take a separate look at that one
2 Views