Skip to content
Using subworkflow n...
 
Notifications
Clear all

Using subworkflow node as a tool in a langchain code node

5 Posts
4 Users
0 Reactions
5 Views
Anthony_Brebion
(@anthony_brebion)
Posts: 5
Active Member
Topic starter
 

Describe the problem/error/question

Hi, I'm encountering an issue while attempting to use the langchain code node with a sub-workflow tool. The code is based on the example from Quickstart | 🦜️🔗 Langchain. Please see the attached workflow.

What is the error message (if any)?

It appears the tool is not being implemented correctly. When I tried to log the result of the custom tool invocation, I received the following message:

[
    {
        "lc": 1,
        "type": "not_implemented",
        "id": [
            "langchain",
            "tools",
            "DynamicTool"
        ]
    }
]

I'm

Please share your workflow

Share the output returned by the last node

[
  {
    "output": {
      "lc": 1,
      "type": "constructor",
      "id": [
        "langchain_core",
        "messages",
        "AIMessage"
      ],
      "kwargs": {
        "content": "",
        "additional_kwargs": {
          "tool_calls": [
            {
              "id": "call_Bl7S32df8y4p3DeoQYSg9zpF",
              "type": "function",
              "function": {
                "name": "fetch_linkedin_profile",
                "arguments": "{"input":"https://example/result.json"}"
              }
            }
          ]
        }
      }
    }
  }
]

Information on your callin.io setup

  • callin.io version: 1.38.1
  • Database (default: SQLite): Postgres
  • callin.io EXECUTIONS_PROCESS setting (default: own, main): Default
  • Running callin.io via (Docker, npm, callin.io cloud, desktop app): Docker
  • Operating system: Debian
 
Posted : 25/04/2024 9:23 pm
oleg
 oleg
(@oleg)
Posts: 7
Active Member
 

Hi, welcome to the community!

There is indeed a bug that prevents custom callin.io tools from executing when using the Langchain code node. I've just pushed a fix and it will be included in the next release (a message will be sent to this channel once it's available).

However, there's also a minor issue with your code: you are not actually executing the function that the LLM suggests. To do this, you'll need to manually extract the toolName, match it to one of the connected tools, and execute it with the arguments provided by the LLM. Here's a slightly modified workflow with these changes:

Once the fix I mentioned above is released, this should function as expected.

 
Posted : 30/04/2024 2:12 pm
Anthony_Brebion
(@anthony_brebion)
Posts: 5
Active Member
Topic starter
 

Thank you. The provided code will certainly guide me on the right path. I’m waiting for the fix to test deeper.

 
Posted : 30/04/2024 2:36 pm
jan
 jan
(@jan)
Posts: 39
Eminent Member
 

A new version callin.io@1.40.0 has been released, which incorporates GitHub PR 9265.

 
Posted : 02/05/2024 12:52 pm
system
(@system)
Posts: 332
Reputable Member
 

This discussion was automatically closed 90 days following the last response. New replies are no longer permitted.

 
Posted : 31/07/2024 12:52 pm
Share: