Skip to content

Is that possible to bring query pipe line 'qp' in to workflow? #15654

Answered by dosubot bot
mraguth asked this question in Q&A
Discussion options

You must be logged in to vote

The error you're encountering, AttributeError: 'QueryPipeline' object has no attribute 'execute', indicates that the QueryPipeline class does not have an execute method. Instead, you should use the run method to execute the pipeline.

Here's how you can modify your workflow step to use the run method:

# Example workflow step using 'qp'
@step
async def naive_rag(ctx: Context, ev: NaiveRAGEvent) -> ResponseEvent:
    query = ev.query
    result = qp.run(input=query)  # Use the 'run' method instead of 'execute'
    print("Naive response:", result)
    return ResponseEvent(
        query=ev.query, source="Naive", response=str(result)
    )

# Define the workflow
workflow = Workflow(
    steps=[…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@mraguth
Comment options

@dosubot
Comment options

Answer selected by mraguth
@mraguth
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant