Find answers from the community

Updated 3 months ago

How are folks sending Python objects to

How are folks sending Python objects to an LLM as context for summarization?

Are you transforming them to JSON first (and then to a string)? Do you have to augment your prompt to explain to the LLM what each field means/does? Do some LLMs happily accept serialized objects? Does pydantic help? Is there a library/service that can do this for you?
L
1 comment
I just throw it into the prompt as a JSON object. Most LLMs figure it out.

Whether or not it needs further explanation kind of depends on how complex or vague the object and its fields are.

If its a pydantic object, there's probably a way to pull in docstrings and field descriptions as well
Add a reply
Sign up and join the conversation on Discord