Skip to content

Add strands-agents example #976

Merged
yitianlian merged 7 commits intoTHUDM:mainfrom
Lawhy:strands-slime
Dec 1, 2025
Merged

Add strands-agents example #976
yitianlian merged 7 commits intoTHUDM:mainfrom
Lawhy:strands-slime

Conversation

@Lawhy
Copy link
Copy Markdown
Contributor

@Lawhy Lawhy commented Nov 30, 2025

Add slime x strands-agents example to showcase how to connect modern agentic training framework with agentic scaffolding framework. This example is adapted from the examples/retool.

Copy link
Copy Markdown
Collaborator

@yitianlian yitianlian left a comment

Choose a reason for hiding this comment

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

I’ve given a few small suggestions.

Comment on lines +221 to +224
sample.payload_text = prompt_text + response_text
sample.payload_has_system = True
sample.payload_has_tools = len(agent.tool_names) > 0
sample.tool_call_count = [message["role"] == "tool" for message in trajectory].count(True)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I believe some of these keys are unnecessary, and the sample class does not support this attribute.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed; only kept tool_call_count

Comment thread examples/strands-agents/generate_with_strands.py
raise TypeError("Sample must be an instance of Sample class.")

# Extract information from sample
solution_str = sample.payload_text
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You can use the sample.response.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread examples/strands-agents/README.md Outdated
## Install Dependencies

1. Pull the `slimerl/slime:latest` image and enter it
2. Goes to slime folder: `cd /root/slime`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Add a clone command?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was thinking /root/slime is already there in the image? Do we still need to clone?

Copy link
Copy Markdown
Collaborator

@yitianlian yitianlian left a comment

Choose a reason for hiding this comment

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

LGTM!

@yitianlian yitianlian merged commit f600569 into THUDM:main Dec 1, 2025
4 checks passed
Fengzdadi pushed a commit to Fengzdadi/slime that referenced this pull request Dec 19, 2025
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