Skip to content

v0.1.0

Choose a tag to compare

@chickenlj chickenlj released this 24 Sep 10:22
· 802 commits to main since this release
89f7381

Please note that this is an early version, so the APIs and dependencies in the current version do not guarantee long-term stability. Future versions might bring breaking changes.

🚀 Quickstart

Installation

AgentScope Java requires jdk 17 or higher.

<dependency>
    <groupId>io.agentscope</groupId>
    <artifactId>agentscope-core</artifactId>
    <version>0.1.0</version>
</dependency>

Hello AgentScope!

Start with a basic ReActAgent that replies to user queries!

public static void main(String[] args) {
    Model model = DashScopeChatModel.builder()
		.apiKey(System.getenv("DASHSCOPE_API_KEY"))
		.modelName("qwen-max")
		.build();

    ReActAgent agent = ReActAgent.builder()
    .name("hello-world-agent")
    .sysPrompt("You are a helpful AI assistant. Be concise and friendly. " +
               "When thinking through problems, use <thinking>...</thinking> tags to show your reasoning.")
    .model(model)
    .memory(new InMemoryMemory())
    .formatter(new DashScopeChatFormatter())
    .build();

    Msg userMessage = Msg.builder()
        .role(MsgRole.USER)
        .textContent("Hello, please introduce yourself.")
        .build();
    Msg response = agent.reply(userMessage).block();

    System.out.println("Agent Response: " + response.getTextContent());
}