Create

Sign in to ReadmeX

or

How we handle your data: Privacy Policy

ReadmeX

Your AI reading companion

What would you like to catch up on?

Pick a briefing, or ask your own question.

Your community and people briefings stay personal to you.

Story

Build a Grounded Python Teaching Assistant with Tool Calling

AI summary

The article presents a Python tutorial for connecting a teaching assistant to local schedule, vocabulary, and learning-record tools. It implements both a manual tool-call loop and a LangGraph-based ReAct workflow, including tool schemas, friendly error handling, step limits, repeated-call detection, and 38 passing offline tests. The article opens by recounting a missed class and an incorrect vocabulary-level answer; these incidents are not independently corroborated in the supplied material.

In-depth insight

The tutorial demonstrates how program-controlled tool execution can ground an assistant’s answers in application data while keeping validation, error handling, and loop termination under the application’s control.

模型只负责想,动手的是你的程序

上周出了一次挺丢人的事故。一个学生问助教小E:"我明天的课是几点?"小E秒回:"您的写作课在周三下午三点,3 号教室。"学生第二天下午三点到了 3 号教室——那天根本没排课,写作课是周六上午的。

另一个学生问"accord 这个词在你们词表里是几级",小E答得更有底气:"C1 级,考研核心词,建议精读。"实际上它在词表里是 B2,考研大纲里压根没有它。

学生白跑一趟还是小事。带队老师看了聊天记录问我:这模型是不是坏了?

模型没坏,它甚至表现得很"称职"——生成一句像模像样的回答本来就是它唯一会做的事。它没有我们的课表,没有我们的词表,你却要求它回答里面的问题,它只能拿训练时见过的模式补全一个"最像答案的文本"。前六篇我们一直在打磨它"怎么说",这一篇要解决的是更根本的问题:让它闭嘴去查。

#LangGraph#langchain-core#Python

Original · 16 min readRead the original
Group chat

No comments yet. Start the conversation.