feat: use Responses protocol for RAG preparation
This commit is contained in:
@@ -48,7 +48,11 @@ def request_body(query: str, evidence: list, options: CompletionOptions):
|
||||
def parse_completion(payload: dict, context: ContextRead) -> ParsedCompletion:
|
||||
"""Structural/citation checks only; a valid citation is not an entailment proof."""
|
||||
try:
|
||||
if context.status != "prepared" or not context.evidence:
|
||||
if (
|
||||
not isinstance(context.completion, CompletionOptions)
|
||||
or context.status != "prepared"
|
||||
or not context.evidence
|
||||
):
|
||||
raise ValueError("context has no evidence")
|
||||
if payload["object"] != "chat.completion":
|
||||
raise ValueError("non-completion response")
|
||||
|
||||
Reference in New Issue
Block a user