Skip to content

docs: updated readmefile to support latest langchain version#364

Open
vkpatva wants to merge 1 commit intohashgraph:mainfrom
vkpatva:doc/langchain-upgradation
Open

docs: updated readmefile to support latest langchain version#364
vkpatva wants to merge 1 commit intohashgraph:mainfrom
vkpatva:doc/langchain-upgradation

Conversation

@vkpatva
Copy link

@vkpatva vkpatva commented Nov 21, 2025

Description:

This PR updates the README.md quick-start example to use the current LangChain v1.0.1+ API in order to ensure the documentation matches working code implementations and provides accurate examples for new users.

The previous example used deprecated LangChain patterns that no longer work with current versions. This update aligns the documentation with the actual working implementation and maintains backward compatibility with multiple AI providers.

  • Replace createToolCallingAgent with createOpenAIToolsAgent for OpenAI models
  • Add conditional logic to use createOpenAIToolsAgent for OpenAI and createToolCallingAgent for other providers (Claude, Groq, Ollama)
  • Update ChatOpenAI initialization to explicitly use modelName and openAIApiKey parameters
  • Remove chat_history placeholder from prompt template to match current working demo structure
  • Add verbose: true to AgentExecutor for better debugging output
  • Support both ACCOUNT_ID/PRIVATE_KEY and HEDERA_ACCOUNT_ID/HEDERA_PRIVATE_KEY environment variable naming conventions
  • Add await keyword for agent creation (required in LangChain v1.0.1+)
  • Update prompt structure to match current LangChain API patterns

Notes for reviewer:

The changes have been tested against a working implementation and verified to match the current LangChain API. The example code:

  • Works with OpenAI using createOpenAIToolsAgent
  • Maintains compatibility with Claude, Groq, and Ollama using createToolCallingAgent
  • Supports flexible environment variable naming
  • Follows the same structure as the working demo in the codebase

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.) - Verified against working implementation

- Replace createToolCallingAgent with createOpenAIToolsAgent for OpenAI
- Add conditional logic to support both OpenAI and other providers
- Update ChatOpenAI initialization to use modelName and openAIApiKey
- Remove chat_history placeholder to match working demo structure
- Add verbose: true to AgentExecutor
- Support both ACCOUNT_ID/PRIVATE_KEY and HEDERA_ACCOUNT_ID/HEDERA_PRIVATE_KEY env vars
- Update example code to match current LangChain API patterns

Signed-off-by: vkpatva <vkpatva.it@gmail.com>
@vkpatva vkpatva requested review from a team as code owners November 21, 2025 10:12
@vkpatva vkpatva requested a review from rbarker-dev November 21, 2025 10:12
@vkpatva vkpatva changed the title Doc: README.md to use LangChain v1.0.1+ API docs: README.md to use LangChain v1.0.1+ API Nov 21, 2025
@vkpatva vkpatva changed the title docs: README.md to use LangChain v1.0.1+ API docs: updated readmefile to support latest langchain version Nov 21, 2025
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.

2 participants