Class BindexBuilder
java.lang.Object
org.machanism.machai.bindex.builder.BindexBuilder
- Direct Known Subclasses:
JScriptBindexBuilder,MavenBindexBuilder,PythonBindexBuilder
Builds and generates Bindex documents from a supplied ProjectLayout using GenAI.
Supports schema prompt, project context retrieval, and AI-driven Bindex creation.
Usage example:
BindexBuilder builder = new BindexBuilder(layout);
builder.genAIProvider(provider);
Bindex bindex = builder.build();
- Since:
- 0.0.2
- Author:
- Viktor Tovstyi
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBindexBuilder(ProjectLayout projectLayout) Constructs a BindexBuilder for the specified ProjectLayout. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbindexSchemaPrompt(org.machanism.machai.ai.manager.GenAIProvider provider) Issues a schema prompt to GenAIProvider for Bindex schema setup.build()Builds a new Bindex, using possible schema prompt, origin update, and AI generation.genAIProvider(org.machanism.machai.ai.manager.GenAIProvider genAIProvider) Sets the GenAIProvider for this builder.org.machanism.machai.ai.manager.GenAIProviderReturns the GenAIProvider for building.Gets the origin Bindex instance.Returns the ProjectLayout for this builder.Sets the origin Bindex for update operations.protected voidDefines project context if needed for the assembly (to be overridden).
-
Field Details
-
BINDEX_TEMP_DIR
-
BINDEX_SCHEMA_RESOURCE
Path to the Bindex schema resource file.
-
-
Constructor Details
-
BindexBuilder
Constructs a BindexBuilder for the specified ProjectLayout.- Parameters:
projectLayout- A project layout to analyze for Bindex generation.
-
-
Method Details
-
build
Builds a new Bindex, using possible schema prompt, origin update, and AI generation.- Returns:
- Newly created Bindex object, or null on failure.
- Throws:
IOException- When prompt or log operations fail, or result cannot be parsed.
-
projectContext
Defines project context if needed for the assembly (to be overridden).- Throws:
IOException- if project context cannot be established.
-
bindexSchemaPrompt
public static void bindexSchemaPrompt(org.machanism.machai.ai.manager.GenAIProvider provider) throws IOException Issues a schema prompt to GenAIProvider for Bindex schema setup.- Parameters:
provider- GenAIProvider to receive schema instructions.- Throws:
IOException- On prompt or IO errors.
-
origin
Sets the origin Bindex for update operations.- Parameters:
bindex- Origin Bindex instance for updates.- Returns:
- This BindexBuilder instance for chain usage.
-
getOrigin
Gets the origin Bindex instance.- Returns:
- The currently set origin Bindex (may be null).
-
getGenAIProvider
public org.machanism.machai.ai.manager.GenAIProvider getGenAIProvider()Returns the GenAIProvider for building.- Returns:
- GenAIProvider used for prompts.
-
genAIProvider
Sets the GenAIProvider for this builder.- Parameters:
genAIProvider- Provider instance.- Returns:
- This BindexBuilder for chain calls.
-
getProjectLayout
Returns the ProjectLayout for this builder.- Returns:
- ProjectLayout used for analysis.
-