CodegenPipeline#
- class ansys.cfx.mcp.common.codegen.CodegenPipeline(*, store: ansys.cfx.mcp.common.conversation.ConversationStore)#
Default pipeline: delegate to the backend.
Subclass and override generate / clarify to add LLM orchestration, retrieval, validation passes, etc.
Overview#
Import detail#
from ansys.cfx.mcp.common.codegen import CodegenPipeline
Attribute detail#
- CodegenPipeline.store#
Method detail#
- async CodegenPipeline.generate(*, backend: ansys.cfx.mcp.common.backend.Backend, prompt: str, session_id: str | None = None, context: dict[str, Any] | None = None) ansys.cfx.mcp.common.models.CodegenResult#
Generate CFX Python code or a clarification response from a user prompt.
- Parameters:
- backend
Backend Backend that provides CFX state, validation, and execution services.
- prompt
str Natural-language user request to process.
- session_id
Optional[str],optional Conversation identifier used to retrieve or continue context. Default is
None.- context
Optional[dict[str,Any]],optional Additional context supplied by the caller. Default is
None.
- backend
- Returns:
CodegenResultGenerated-code response or clarification request.
- async CodegenPipeline.clarify(*, backend: ansys.cfx.mcp.common.backend.Backend, session_id: str, clarification_id: str, answer: str) ansys.cfx.mcp.common.models.CodegenResult#
Continue code generation after a clarification answer.
- Parameters:
- Returns:
CodegenResultGenerated-code response or clarification request.