Skip to content

docs(integration): fix broken LangChain adapter example in uagents-adapter README - #933

Open
feizhuzheng wants to merge 1 commit into
fetchai:mainfrom
feizhuzheng:fix/langchain-readme-result-keys
Open

docs(integration): fix broken LangChain adapter example in uagents-adapter README#933
feizhuzheng wants to merge 1 commit into
fetchai:mainfrom
feizhuzheng:fix/langchain-readme-result-keys

Conversation

@feizhuzheng

Copy link
Copy Markdown

The LangChain adapter's quick-start example prints result['agent_name'], result['agent_address'] and result['agent_port'], but LangchainRegisterTool._run builds its result dict with the keys name, port and address (see langchain/tools.py lines 136-140 and 154) — it never emits agent_* keys. So copy-pasting the documented example raises KeyError: 'agent_name'.

The identical print line in the CrewAI section (README line 117) is correct, because CrewaiRegisterTool._run does build agent_name/agent_address/agent_port (crewai/tools.py lines 635-642). The LangChain line looks like it was copied from the CrewAI example without adapting to the different return contract.

Fix: update the LangChain example's print line to use the keys the LangChain tool actually returns (name/address/port). Doc-only, one line; the CrewAI example is left untouched.

(Alternatively the two adapters' return contracts could be aligned on the code side, but this doc fix is the minimal change.)

Verified by reading both adapters' tools.py and both README examples on main.

@feizhuzheng feizhuzheng changed the title docs(langchain): fix result dict keys in adapter README example docs(integration): fix broken LangChain adapter example in uagents-adapter README Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant