@@ -30,35 +30,28 @@ Follow these steps to get started with AgentScope Java:
3030
31311 . ** [ Installation] ( quickstart/installation.md ) ** - Set up AgentScope Java in your project
32322 . ** [ Key Concepts] ( quickstart/key-concepts.md ) ** - Understand core concepts and architecture
33- 3 . ** [ Message System] ( quickstart/message.md ) ** - Learn about the message system
34- 4 . ** [ Build Your First Agent] ( quickstart/agent.md ) ** - Create a working agent
33+ 3 . ** [ Build Your First Agent] ( quickstart/agent.md ) ** - Create a working agent
3534
3635## Quick Example
3736
3837``` java
3938import io.agentscope.core.ReActAgent ;
4039import io.agentscope.core.model.DashScopeChatModel ;
4140import io.agentscope.core.message.Msg ;
42- import io.agentscope.core.message.MsgRole ;
43- import io.agentscope.core.message.TextBlock ;
4441
45- // Create a model
46- var model = DashScopeChatModel . builder()
47- .apiKey(System . getenv(" DASHSCOPE_API_KEY" ))
48- .modelName(" qwen-plus" )
49- .build();
50-
51- // Create an agent
42+ // Create an agent with inline model configuration
5243var agent = ReActAgent . builder()
5344 .name(" Assistant" )
54- .model(model)
45+ .model(DashScopeChatModel . builder()
46+ .apiKey(System . getenv(" DASHSCOPE_API_KEY" ))
47+ .modelName(" qwen-plus" )
48+ .build())
5549 .sysPrompt(" You are a helpful assistant." )
5650 .build();
5751
5852// Call the agent
5953Msg userMsg = Msg . builder()
60- .role(MsgRole . USER )
61- .content(TextBlock . builder(). text(" Hello!" ). build())
54+ .textContent(" Hello!" )
6255 .build();
6356
6457Msg response = agent. call(userMsg). block();
0 commit comments