🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
import type { InAppAgentQuestionnaireAnswers } from "@langfuse/shared/in-app-agent";
import type { QuestionnaireFormValues } from "./createQuestionnaireFormValues";
export function toQuestionnaireAnswers(
values: QuestionnaireFormValues,
): InAppAgentQuestionnaireAnswers {
return values.answers.map((answer) => {
const otherText = answer.otherText.trim();
return {
selectedOptionIndexes: [...answer.selectedOptionIndexes].sort(
(a, b) => a - b,
),
otherText: otherText.length > 0 ? otherText : null,
};
});
}