The GitHub Actions job "Required Checks" on texera.git/main has succeeded.
Run started by GitHub user github-merge-queue[bot] (triggered by 
github-merge-queue[bot]).

Head commit for run:
2113455e3f384912d721893147e3dfd329df1126 / Prateek Ganigi 
<[email protected]>
fix(workflow-operator): carry structured task context into chat fallback 
payloads (#7798)

### What changes were proposed in this PR?

The five structured Hugging Face tasks (`question-answering`,
`table-question-answering`, `zero-shot-classification`,
`sentence-similarity`, `text-ranking`) build a native HF pipeline
payload that only `hf-inference` understands. When the operator fell
back to a third-party chat-completions provider, all three chat branches
sent just the prompt cell, dropping the
context, table, candidate labels, or sentence list, so the model
answered without the input that defines the task.

This adds a `_chat_content_for_task` helper to the generated operator
that reformulates each of the five tasks into a chat prompt carrying its
full context, and routes all three chat branches (zai-org,
OpenAI-compatible, unknown-provider fallback) through it. Other tasks
pass through unchanged. `QaRankingCodegen.parsePython` is also extended
to read `choices[0].message.content` from chat responses, keeping the
native `{"answer": ...}` shape as the primary path, the same idiom
`ImageTaskCodegen` already uses.

### Any related issues?

Closes #7195

### How was this PR tested?

131 tests pass in the `WorkflowOperator` Hugging Face suites,
`PythonCodeRawInvalidTextSpec` py-compiles the generated Python for all
117 operators, and `scalafmtCheck` is clean for main and test sources. A
new spec test asserts the helper is emitted and used by every chat
branch, with one assertion per task reformulation; two existing tests
were updated where they pinned the old parse expression.

### Was this PR authored or co-authored using generative AI tooling?

Yes, this PR was co-authored with Claude in compliance with ASF policy.

Report URL: https://github.com/apache/texera/actions/runs/32677828969

With regards,
GitHub Actions via GitBox

Reply via email to