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

[agents] Add Agent to call LangServe (langserve-invoke) #673

Merged
merged 5 commits into from
Oct 31, 2023

Conversation

eolivelli
Copy link
Member

@eolivelli eolivelli commented Oct 31, 2023

Summary:

  • add a new agent "langserve-invoke" that is able to make a call to LangServe
  • support both "invoke" and "stream" endpoints
  • in case of "stream" endpoints you can configure the "stream-to-topic" property, like in the ai-chat-completion agent

When doing streaming answers the chunking is performed the same way as the ai-chat-completion agent, and we are adding the same properties to the messages. This way the sample JS applications still work out of the box.

There is a sample application included with this PR.

Sample pipeline:

pipeline:
  - type: "langserve-invoke"
    input: input-topic
    output: output-topic
    id: step1
    configuration:
      output-field: value.answer
      stream-to-topic: streaming-answers-topic
      stream-response-field: value
      min-chunks-per-message: 10
      debug: false
      method: POST
      allow-redirects: true
      handle-cookies: false
      url: "http://host.docker.internal:8000/chain/stream"
      fields:
        - name: topic
          expression: "value"

Copy link
Member

@nicoloboschi nicoloboschi left a comment

Choose a reason for hiding this comment

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

LGTM

@eolivelli eolivelli marked this pull request as ready for review October 31, 2023 12:07
@eolivelli eolivelli changed the title [agents] Add Agent to call LangServe [agents] Add Agent to call LangServe (langserve-invoke) Oct 31, 2023
@eolivelli eolivelli merged commit c11d8ea into main Oct 31, 2023
9 of 10 checks passed
@eolivelli eolivelli deleted the impl/langserve-call branch October 31, 2023 12:48
benfrank241 pushed a commit to vectorize-io/langstream that referenced this pull request May 2, 2024
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