Updated app

This commit is contained in:
Leon Serfaty G
2025-07-17 10:06:15 +00:00
parent 771048d9f8
commit 4b7d3b2b3d
14 changed files with 376 additions and 64 deletions
+5 -1
View File
@@ -1 +1,5 @@
// Flows will be imported for their side effects in this file.
import { config } from 'dotenv';
config();
import '@/ai/flows/suggest-features.ts';
import '@/ai/flows/classify-complexity.ts';
+52
View File
@@ -0,0 +1,52 @@
// This is an autogenerated file from Firebase Studio.
'use server';
/**
* @fileOverview This file defines a Genkit flow for classifying the complexity of project features.
*
* - classifyComplexity - An async function that takes a feature description and returns its complexity classification.
* - ClassifyComplexityInput - The input type for the classifyComplexity function.
* - ClassifyComplexityOutput - The output type for the classifyComplexity function.
*/
import {ai} from '@/ai/genkit';
import {z} from 'genkit';
const ClassifyComplexityInputSchema = z.object({
featureDescription: z
.string()
.describe('A detailed description of the feature to be classified.'),
});
export type ClassifyComplexityInput = z.infer<typeof ClassifyComplexityInputSchema>;
const ClassifyComplexityOutputSchema = z.object({
complexity: z
.enum(['simple', 'medium', 'complex'])
.describe('The complexity classification of the feature.'),
});
export type ClassifyComplexityOutput = z.infer<typeof ClassifyComplexityOutputSchema>;
export async function classifyComplexity(
input: ClassifyComplexityInput
): Promise<ClassifyComplexityOutput> {
return classifyComplexityFlow(input);
}
const prompt = ai.definePrompt({
name: 'classifyComplexityPrompt',
input: {schema: ClassifyComplexityInputSchema},
output: {schema: ClassifyComplexityOutputSchema},
prompt: `You are an expert project manager classifying the complexity of software features. Classify the following feature description as either 'simple', 'medium', or 'complex'.\n\nFeature Description: {{{featureDescription}}}\n\nComplexity:`,
});
const classifyComplexityFlow = ai.defineFlow(
{
name: 'classifyComplexityFlow',
inputSchema: ClassifyComplexityInputSchema,
outputSchema: ClassifyComplexityOutputSchema,
},
async input => {
const {output} = await prompt(input);
return output!;
}
);
+59
View File
@@ -0,0 +1,59 @@
'use server';
/**
* @fileOverview AI-powered feature suggestion flow based on project description.
*
* - suggestFeatures - A function that suggests features for a project based on its description.
* - SuggestFeaturesInput - The input type for the suggestFeatures function.
* - SuggestFeaturesOutput - The return type for the suggestFeatures function.
*/
import {ai} from '@/ai/genkit';
import {z} from 'genkit';
const SuggestFeaturesInputSchema = z.object({
projectDescription: z
.string()
.describe('A brief description of the digital product or project.'),
});
export type SuggestFeaturesInput = z.infer<typeof SuggestFeaturesInputSchema>;
const SuggestFeaturesOutputSchema = z.object({
suggestedFeatures: z
.array(z.string())
.describe('An array of suggested features for the project.'),
scopeDefinitions: z
.string()
.describe('A paragraph defining the overall scope of the project.'),
});
export type SuggestFeaturesOutput = z.infer<typeof SuggestFeaturesOutputSchema>;
export async function suggestFeatures(input: SuggestFeaturesInput): Promise<SuggestFeaturesOutput> {
return suggestFeaturesFlow(input);
}
const prompt = ai.definePrompt({
name: 'suggestFeaturesPrompt',
input: {schema: SuggestFeaturesInputSchema},
output: {schema: SuggestFeaturesOutputSchema},
prompt: `You are an AI assistant helping to define the scope and features of digital projects.
Based on the following project description, suggest a list of potential features and a paragraph defining the project's scope.
Project Description: {{{projectDescription}}}
Format the features as a bulleted list and provide a concise scope definition.
`,
});
const suggestFeaturesFlow = ai.defineFlow(
{
name: 'suggestFeaturesFlow',
inputSchema: SuggestFeaturesInputSchema,
outputSchema: SuggestFeaturesOutputSchema,
},
async input => {
const {output} = await prompt(input);
return output!;
}
);