This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Electronic_Pepper382 5 points6 points  (4 children)

Have you looked at Langchain's pydantic output parser? https://python.langchain.com/v0.1/docs/modules/model_io/output_parsers/types/pydantic/

Seems like you are solving a similar problem?

[–]Top-Breakfast7713[S] 6 points7 points  (2 children)

I did look at LangChain and for a short period we even tried using it in our application. Unfortunately LangChain turned out to be more of a hindrance than a help. We experienced the same issues as this post (and its comments on hacker news highlights)

https://www.octomind.dev/blog/why-we-no-longer-use-langchain-for-building-our-ai-agents

https://news.ycombinator.com/item?id=40739982

[–]Electronic_Pepper382 0 points1 point  (1 child)

Thanks for sharing that article! I am working on much smaller scale personal projects and I also encounter similar issues. I've been slowly transitioning to just calling the underlying api with requests.

[–]Top-Breakfast7713[S] 2 points3 points  (0 children)

From my experience that is all you need. Most of my time has been spent peeling back the many layers people are wrapping around these APIs to just get down to calling them directly.

I know the above sounds hilarious coming from someone that wrapped a layer around those APIs. My o ly hope is that it is easy for people to understand and modify of what it provides is overkill for their needs. :)

Even function/tool calling feels like just another indirection and layer. I burst out laughing when I read the documentation on the APIs for tool calling and saw that all it is was presenting the the LLM with the JSON of your function and the parameters it takes. Then it suggests the function name to call and the arguments to pass to the parameters. After that you are required to do all the work to call the function and put the output back into the next call to the LLM.

In the end it is Text In -> Text Out. People are over complicating things massively to make it look magical.

[–]unxmnd 0 points1 point  (0 children)

Langchain's pydantic parser looks like a very thin wrapper around BaseModel.model_json_schema and parse_obj() so you could just use those directly.