import { getOrganizationEndpoint } from '../../../../../platform-client.js';
/**
 * Builds the complete URL for the follow up endpoint.
 */
export const buildFollowUpEndpointUrl = (state) => {
    const { configuration, generatedAnswer } = state;
    const { organizationId, environment } = configuration;
    const platformEndpoint = getOrganizationEndpoint(organizationId, environment);
    if (!platformEndpoint ||
        !organizationId ||
        !generatedAnswer.answerConfigurationId) {
        throw new Error('Missing required parameters for follow up endpoint');
    }
    const basePath = `/rest/organizations/${organizationId}/answer/v1/configs`;
    return `${platformEndpoint}${basePath}/${generatedAnswer.answerConfigurationId}/generate`;
};
