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