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

Promptly: Anthropic processor always run in parallel #261

Closed
tomasmcm opened this issue Aug 1, 2024 · 5 comments
Closed

Promptly: Anthropic processor always run in parallel #261

tomasmcm opened this issue Aug 1, 2024 · 5 comments

Comments

@tomasmcm
Copy link

tomasmcm commented Aug 1, 2024

Describe the bug
If I have 2 or more Anthropic processors in a Web App they always run in parallel. Even when I define messages in the second processor that use the first processor as input.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new Web App
  2. Add an Anthropic processor with 1 user message
  3. Add an Anthropic processor with 1 user message (the same as in step 2.), 1 assistant message (with the output of step 2.), and 1 user message (with a new message)
  4. Run the app

Expected behavior
Since the second processor depends on the output of the first it should only run after the first one finishes, as it happens with the Azure processor for example

Version
Latest

Environment
Chrome Mac

@ajhai
Copy link
Contributor

ajhai commented Aug 1, 2024

@tomasmcm can you share your app yaml so we can replicate this and see whats happening?

@tomasmcm
Copy link
Author

tomasmcm commented Aug 1, 2024

@ajhai of course. Here you go:

name: step1
config:
  layout: |-
    <pa-layout sx='{"maxWidth": "1200px", "margin": "10px auto"}'>
      <pa-paper style="padding: 10px;">
        <pa-grid container="true" spacing="2" style="width: 100%">
          <pa-grid item="true" xs="12">
            <pa-input-form workflow="true"></pa-input-form>
          </pa-grid>
          <pa-grid item="true" xs="12">
            <br/>
          </pa-grid>
          <pa-grid item="true" xs="12">
            <pa-workflow-output showHeader="true"></pa-workflow-output>
          </pa-grid>
        </pa-grid>
      </pa-paper>
    </pa-layout>
  allowed_sites: []
  input_template: ''
type_slug: web
processors:
  - id: messages1
    name: Messages
    input:
      messages:
        - role: user
          message: 'My name is {{_inputs0.Field1}} '
    config:
      model: claude-3-haiku
      max_tokens: 256
      temperature: 0.5
      system_prompt: ''
      retain_history: false
    description: Claude chat messages
    input_fields: []
    provider_slug: anthropic
    processor_slug: messages
    output_template:
      markdown: '{{message}}'
  - id: messages2
    name: Messages
    input:
      messages:
        - role: user
          message: 'My name is {{_inputs0.Field1}} '
        - role: assistant
          message: '{{messages1.message}} '
        - role: user
          message: What's my name?
    config:
      model: claude-3-haiku
      max_tokens: 256
      temperature: 0.5
      system_prompt: ''
      retain_history: false
    description: Claude chat messages
    input_fields: []
    provider_slug: anthropic
    processor_slug: messages
    output_template:
      markdown: '{{message}}'
description: ''
input_fields:
  - name: Field1
    type: string
    title: Field1
    required: true
    description: Description for Field1
output_template:
  markdown: |-
    1. {{messages1.message}} 
    2. {{messages2.message}} 
version: 1
is_published: true
web_config: null
twilio_config: null
slack_config: null
discord_config: null

@ajhai
Copy link
Contributor

ajhai commented Aug 1, 2024

Thanks for reporting this. We found the issue. Should be fixed in the next release which should be out later today.

@ajhai
Copy link
Contributor

ajhai commented Aug 2, 2024

@tomasmcm please try the latest release let me know if you are still seeing this issue.

@ajhai ajhai closed this as completed Aug 2, 2024
@tomasmcm
Copy link
Author

tomasmcm commented Aug 2, 2024

@ajhai I'm sorry, this is not working yet.
If I enable "retain history" the 2 processors are still running at the same time, and the second does not have access to the first one's messages.
If I disable "retain history" and include the response from the first processor in the messages of the second (like the yaml I shared) I get 1 validation error for BookKeepingData session_data none is not an allowed value (type=type_error.none.not_allowed). Probably because it is still trying to run in parallel and Anthropic does not allow sending empty messages.

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

No branches or pull requests

2 participants