Skip to content

Conversation

@nrfulton
Copy link
Contributor

@nrfulton nrfulton commented Nov 17, 2025

This PR focuses on factoring @0xCUB3's code out of the reqlib and into a new tools module. I also added some tool/code_interpreter-specific requirements.

The PR message here used to mention a bunch of other tool use stuff, which I've moved into #235 so that progress on that work doesn't block merging this PR.

@nrfulton nrfulton changed the title [feat] Melleaic Tool Use feat: Melleaic Tool Use Nov 17, 2025
@mergify
Copy link

mergify bot commented Nov 17, 2025

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|release)(?:\(.+\))?:

@nrfulton nrfulton force-pushed the nathan/tools_reqlib branch from b568898 to b72ac1b Compare November 20, 2025 14:27
@nrfulton nrfulton changed the title feat: Melleaic Tool Use feat: code_interpreter Nov 20, 2025
@nrfulton nrfulton marked this pull request as ready for review November 20, 2025 17:04
@nrfulton nrfulton self-assigned this Nov 20, 2025
def to_validationresult_reason(self):
"""Maps an ExecutionResult to a ValidationResult reason.

TODO: Downstream use of this method is really hacky. A far better solution is for `ExecutionResult` to implement the `ValidationResult` interface.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracking on #234

"""Execute code and return result."""


class StaticAnalysisEnvironment(ExecutionEnvironment):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also as part of #234's work on subtyping ValidationResult, we could have a StaticAnalysisReseult instead of ExecutionResult.

skip_message=f"Unauthorized imports detected: {', '.join(unauthorized)}",
)

try:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requirement has already been added to the pyproject.toml. It should probably be moved to the top-level.

I am going to merge this PR without changing this because we already had this non-top-level import in the original version of this code (in reqlib).

@0xCUB3 can you comment on why we would be doing this here and catching the import error?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I honestly didn't consider that when writing this code. If the dependency is already in pyproject.toml as a req'd package, the import should just be at the top level since the package will always be installed. The only reason to keep this try/except pattern would be if we want to make this an optional dependency (moved to an extras group in pyproject.toml for instance), else it's redundant error handling.

@nrfulton nrfulton mentioned this pull request Nov 20, 2025
4 tasks
@nrfulton nrfulton merged commit b03c964 into generative-computing:main Nov 20, 2025
4 checks passed
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.

2 participants