Skip to content

fix: guard against None cost when using local LLMs without pricing#317

Open
nuthalapativarun wants to merge 1 commit intomicrosoft:pre-releasefrom
nuthalapativarun:fix/nonetype-cost-increment
Open

fix: guard against None cost when using local LLMs without pricing#317
nuthalapativarun wants to merge 1 commit intomicrosoft:pre-releasefrom
nuthalapativarun:fix/nonetype-cost-increment

Conversation

@nuthalapativarun
Copy link
Copy Markdown

Summary

  • Fix TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType' crash when using local LLM providers (e.g. Ollama) that return None for cost

Changes

  • ufo/module/basic.py: replace self.cost += cost with self.cost += cost or 0 in both save_experience and evaluation methods — local LLMs do not return a cost value, so cost is None

Related Issue

Fixes #186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant