61
/** Response with empty answers for every question (used when there is no session to ask). */
62
export function emptyUserInputResponse(questions: readonly ToolRequestUserInputQuestion[]): ToolRequestUserInputResponse {
64
>
for (const q of questions) {
65
>
out[q.id] = { answers: [] };
66
>
}
67
>
return { answers: out };
68
>
}
69
70
/** Flatten a single chat input answer into the string array codex expects. */
71
export function answerStrings(answer: ChatInputAnswer | undefined, response: ChatInputResponseKind): string[] {
72
if (response !== ChatInputResponseKind.Accept || !answer || answer.state === ChatInputAnswerState.Skipped) {
74
>
}
75
const { value } = answer;
76
switch (value.kind) {