Add optional multi-provider LLM code generation to the OpenCAD agent#13
Add optional multi-provider LLM code generation to the OpenCAD agent#13
Conversation
Co-authored-by: isayahc <18591926+isayahc@users.noreply.github.com>
Co-authored-by: isayahc <18591926+isayahc@users.noreply.github.com>
Co-authored-by: isayahc <18591926+isayahc@users.noreply.github.com>
isayahc
left a comment
There was a problem hiding this comment.
Provide an example of how it is to be used in example/agentsdirectory
Co-authored-by: isayahc <18591926+isayahc@users.noreply.github.com>
Added a runnable example under |
isayahc
left a comment
There was a problem hiding this comment.
make sure you also include a claude and gemini example for llms
Co-authored-by: isayahc <18591926+isayahc@users.noreply.github.com>
Added explicit Claude and Gemini usage examples to |
isayahc
left a comment
There was a problem hiding this comment.
does this library need litellm to run?
No — |
OpenCAD’s agent could only follow a built-in deterministic planning path. This change adds an optional multi-provider LLM path for generating OpenCAD scripts in the same style as the repository examples, while keeping the existing execution flow unchanged.
Agent API
/chatrequest handling with:llm_providerllm_modelgenerate_codegenerated_codeProvider abstraction
openai/gpt-4o-mini)Example-style code generation
examples/Planner compatibility
Packaging, docs, and examples
llmextra for LiteLLM supportexamples/agents/examples/agents/README.mdExample request shape:
{ "message": "Generate a mounting bracket script with corner fasteners and a center cutout", "tree_state": { "root_id": "root", "nodes": {} }, "conversation_history": [], "reasoning": true, "generate_code": true, "llm_provider": "openai", "llm_model": "gpt-4o-mini" }Example generated code shape:
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.