Find answers from the community

Updated 3 months ago

What do these options mean?

What do these options mean?

class PydanticProgramMode(str, Enum):
"""Pydantic program mode."""

DEFAULT = "default"
OPENAI = "openai"
LLM = "llm"
GUIDANCE = "guidance"
LM_FORMAT_ENFORCER = "lm-format-enforcer"

(llama_index/core/types.py)
W
N
L
5 comments
I think they are the modes for output parsers
Where can i find documentation for the differences between these?
Not able to find it at the moment. will share if I find anything related to this!
Thanks a lot!
This helps control the mode when llm.structured_predict() is called (been meaning to make this method more used in the framework, but you can also use it directly too)

Specifically, its controlling the type of pydantic program being used
  • default tries FunctionCallingProgram (openai, anthropic, mistral), if that fails, it uses LLMTextCompletionProgram
  • guidance is GuidancePydanticProgram, it uses the guidance library under the hood (i'm not entirely sure if this works with every llm?)
  • llm format enforcer is another library, I also think it only works with specific LLMs
Add a reply
Sign up and join the conversation on Discord