How to configure and customize OpenSWE for custom libraries
shouldUseCustomFramework(config)
function checks if config.configurable?.customFramework === true
.
customFramework
is true
, we inject a series of custom prompts and tools into the agent. The table below shows every place in the codebase that needs updating if you’re customizing it for a framework other than LangGraph.
Component | File | Prompt Constant | Description |
---|---|---|---|
Planner | prompt.ts | EXTERNAL_FRAMEWORK_DOCUMENTATION_PROMPT | Adds framework documentation access instructions |
Planner | prompt.ts | EXTERNAL_FRAMEWORK_PLAN_PROMPT | Provides framework-specific planning requirements |
Programmer | prompt.ts | CUSTOM_FRAMEWORK_PROMPT | Comprehensive framework implementation patterns and best practices |
Reviewer | prompt.ts | CUSTOM_FRAMEWORK_PROMPT | Framework validation and testing requirements |
Component | File | Description |
---|---|---|
Toggle Button | default-view.tsx | Contains the LangGraph Engineer toggle button - modify this to add your own button or change the existing one |
Framework Logic | should-use-custom-framework.ts | Logic function that determines when to enable custom framework features. Currently a boolean based on the UI toggle |
Documentation | constants.ts | MCP server configuration for framework documentation access |
CUSTOM_FRAMEWORK_PROMPT
with your framework’s patternsEXTERNAL_FRAMEWORK_DOCUMENTATION_PROMPT
with your docs access instructionsEXTERNAL_FRAMEWORK_PLAN_PROMPT
with your planning requirementsdefault-view.tsx
:
customFramework: true
configuration and modify the prompts to match your framework instead of LangGraph (no additional code changes needed)yourFramework: true
) and adding the detection logic similar to should-use-custom-framework.ts
constants.ts
: