debug
This commit is contained in:
12
nanocode.py
12
nanocode.py
@@ -278,7 +278,7 @@ class ToolLoggingCallback(BaseCallback):
|
||||
|
||||
class RLMCodingConfig(PrecompiledConfig):
|
||||
max_iters: int = 50
|
||||
lm: str = "openrouter/anthropic/claude-sonnet-4.5"
|
||||
lm: str = "openrouter/openai/gpt-5.2-codex"
|
||||
sub_lm: str = "openrouter/openai/gpt-5-mini"
|
||||
api_base: str = "https://openrouter.ai/api/v1"
|
||||
max_tokens: int = 32000
|
||||
@@ -302,16 +302,14 @@ class RLMCodingProgram(PrecompiledProgram):
|
||||
"run_bash": run_bash,
|
||||
}
|
||||
|
||||
# tool logging for introspections on multi-turn conversations
|
||||
dspy.settings.configure(callbacks=[ToolLoggingCallback()])
|
||||
self.lm = dspy.LM(
|
||||
self.config.lm,
|
||||
model=self.config.lm,
|
||||
api_base=self.config.api_base,
|
||||
max_tokens=self.config.max_tokens,
|
||||
track_usage=self.config.track_usage,
|
||||
)
|
||||
self.sub_lm = dspy.LM(
|
||||
self.config.sub_lm,
|
||||
model=self.config.sub_lm,
|
||||
api_base=self.config.api_base,
|
||||
max_tokens=self.config.max_tokens,
|
||||
track_usage=self.config.track_usage,
|
||||
@@ -325,6 +323,8 @@ class RLMCodingProgram(PrecompiledProgram):
|
||||
verbose=self.config.verbose,
|
||||
)
|
||||
agent.set_lm(self.lm)
|
||||
print(f"Using model: {self.lm.model}")
|
||||
print(f"Using sub-model: {self.sub_lm.model}")
|
||||
self.agent = agent
|
||||
|
||||
def forward(self, task: str) -> str:
|
||||
@@ -595,5 +595,5 @@ def main():
|
||||
|
||||
if __name__ == "__main__":
|
||||
agent = RLMCodingProgram(RLMCodingConfig())
|
||||
agent.push_to_hub(MODAIC_REPO_PATH, commit_message="Add MCP server support and long paste handling", tag="v0.0.4")
|
||||
agent.push_to_hub(MODAIC_REPO_PATH, commit_message="debug", tag="v0.0.5")
|
||||
#main()
|
||||
|
||||
Reference in New Issue
Block a user