Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when generating a new user-story project #9

Open
DvirH opened this issue Jul 3, 2023 · 1 comment
Open

Error when generating a new user-story project #9

DvirH opened this issue Jul 3, 2023 · 1 comment

Comments

@DvirH
Copy link

DvirH commented Jul 3, 2023

Problem
I'm getting the following error when running yarn: backend dev command for a new user story:

generateComponents start
generateSkeletonCompositionFromStory: generating configuration
generateSkeletonCompositionFromStory: composition saved
generateComponentsConfigurations: generating configuration
TypeError: uiComponents.filter is not a function
    at C:\Projects\react.agent\backend\main\react-agent\generateComponentsConfigurations.ts:43:47
    at Generator.next (<anonymous>)
    at fulfilled (C:\Projects\react.agent\backend\main\react-agent\generateComponentsConfigurations.ts:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

How to reproduce?

  1. Create a new directory with any name under frontend/main/src/react-agent
  2. Clone the user story.md file from AnalyticsDashboard
  3. run yarn: backend dev command

It seems like the components.json missing the uiComponent property for some of the components which leads to an error.

@mishraabhay2010
Copy link

mishraabhay2010 commented Jul 12, 2023

Hi @DvirH
With gpt-3.5-turbo, looks like JSON array is returning in uiComponents.components object. Change this line and see result.
const existingComponents = uiComponents.components.filter(doesComponentExist);

Updated method :

const getFullConfigurations = async (component: Component) => {
try {
const uiComponents = await componentsPickerGenerator.pickComponents({
description: JSON.stringify(component),
});
// filter non existing components
const existingComponents = uiComponents.components.filter(doesComponentExist);
return { ...component, uiComponents: existingComponents };
} catch (e) {
console.error(e);
return component;
}
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants