Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Haystack and Langchain Nodes #1420

Open
wants to merge 25 commits into
base: branch-24.06
Choose a base branch
from

Conversation

bsuryadevara
Copy link
Contributor

Description

Closes

By Submitting this PR I confirm:

  • I am familiar with the Contributing Guidelines.
  • When the PR is ready for review, new or existing tests cover these changes.
  • When the PR is ready for review, the documentation is up to date with these changes.

@bsuryadevara bsuryadevara added non-breaking Non-breaking change feature request New feature or request sherlock Issues/PRs related to Sherlock workflows and components labels Dec 11, 2023
@bsuryadevara bsuryadevara self-assigned this Dec 11, 2023
@bsuryadevara bsuryadevara linked an issue Dec 11, 2023 that may be closed by this pull request
2 tasks
@bsuryadevara
Copy link
Contributor Author

bsuryadevara commented Dec 11, 2023

@mdemoret-nv I have attempted to incorporate Haystack agents into a simple pipeline, and there are a few crucial points I'd like to bring to your attention. Additionally, I'd like to confirm whether we want to proceed with this approach before drafting comparison tests.

  1. Haystack have neither pre-built tools (unlike langchain) nor examples that shows how to implement custom tools.
  2. Calculator tool is not available.
  3. Results are varying for every run and it does work only with SERPDEV_API_KEY, but not SERPAPI_API_KEY
  4. Haystack 2.0 (Future release) will have lot of breaking API changes.

If don't add the custom calculator tool, I keep getting Calculator tool missing error. However adding custom tool is not giving expected results for all runs.

Exception occurred in pipeline. Rethrowing
Traceback (most recent call last):
  File "/home/bsuryadevara/Github/morpheus/morpheus/pipeline/pipeline.py", line 419, in join
    await executor.join_async()
  File "/home/bsuryadevara/mambaforge/envs/morpheus/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/home/bsuryadevara/mambaforge/envs/morpheus/lib/python3.10/asyncio/tasks.py", line 650, in _wrap_awaitable
    return (yield from awaitable.__await__())
  File "/home/bsuryadevara/Github/morpheus/morpheus/llm/nodes/haystack_agent_node.py", line 70, in execute
    results = await self._run_single(**input_dict)
  File "/home/bsuryadevara/Github/morpheus/morpheus/llm/nodes/haystack_agent_node.py", line 59, in _run_single
    results = await asyncio.gather(*tasks)
  File "/home/bsuryadevara/mambaforge/envs/morpheus/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/bsuryadevara/mambaforge/envs/morpheus/lib/python3.10/site-packages/haystack/agents/base.py", line 365, in run
    agent_step = self._step(query, agent_step, params)
  File "/home/bsuryadevara/mambaforge/envs/morpheus/lib/python3.10/site-packages/haystack/agents/base.py", line 381, in _step
    observation = self.tm.run_tool(next_step.prompt_node_response, params) if not next_step.is_last() else None
  File "/home/bsuryadevara/mambaforge/envs/morpheus/lib/python3.10/site-packages/haystack/agents/base.py", line 164, in run_tool
    tool: Tool = self.tools[tool_name]
KeyError: 'Calculator'

Run command:

python examples/llm/main.py agents simple --llm_orch haystack

@bsuryadevara bsuryadevara marked this pull request as ready for review December 13, 2023 17:28
@bsuryadevara bsuryadevara requested a review from a team as a code owner December 13, 2023 17:28
Copy link
Contributor

@mdemoret-nv mdemoret-nv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to look more closely at the calculator to see if there are better options

docker/conda/environments/cuda11.8_dev.yml Outdated Show resolved Hide resolved
morpheus/llm/nodes/haystack_agent_node.py Outdated Show resolved Hide resolved
morpheus/llm/nodes/haystack_agent_node.py Outdated Show resolved Hide resolved
Copy link

copy-pr-bot bot commented Dec 20, 2023

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@bsuryadevara
Copy link
Contributor Author

Including LlamaIndex functionality in this PR

@bsuryadevara
Copy link
Contributor Author

bsuryadevara commented Jan 2, 2024

Noticed below dependencies version updates when installing cuda11.8_examples.yml
Screenshot from 2024-01-02 09-19-56

I'm able to run all LLM tests on my local after applying cuda11.8_examples.yml, but CI is failing with module not found errors (openai, haystack).
image

@bsuryadevara
Copy link
Contributor Author

/ok to test

@bsuryadevara
Copy link
Contributor Author

/ok to test

@bsuryadevara
Copy link
Contributor Author

/ok to test

@bsuryadevara bsuryadevara changed the title Create Haystack Node Create Haystack and Langchain Nodes Jan 8, 2024
@mdemoret-nv mdemoret-nv changed the base branch from branch-24.03 to branch-24.06 April 6, 2024 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request non-breaking Non-breaking change sherlock Issues/PRs related to Sherlock workflows and components
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

[FEA]: Create Haystack LLM Node
2 participants