Find answers from the community

Updated 3 months ago

Hi, I'm going through the new `lm-format

Hi, I'm going through the new lm-format-enforcer readme: https://docs.llamaindex.ai/en/stable/community/integrations/lmformatenforcer.html#lm-format-enforcer . When defining a program how do I pass in my list of Node or Document objects so the program runs in the context of my data? I would have expected that I can pass in nodes in here:
Plain Text
nodes = node_parser.get_nodes_from_documents(documents)  # existing setup

program = LMFormatEnforcerPydanticProgram(
    output_cls=Album,
    prompt_template_str="Generate an example album, with an artist and a list of songs. Using the movie {movie_name} as inspiration. You must answer according to the following schema: \n{json_schema}\n",
    llm=LlamaCPP(),
    verbose=True,
)
L
k
2 comments
All the programs just run on text

output = Program(movie_name="name")

So you'd have to add a variable for context and manually insert it

We have an integration in our query engines for programs, but I don't think it works with LMFormatEnforcerPydanticProgram yet
Add a reply
Sign up and join the conversation on Discord