Skip to content

Getting Started

Welcome to Astrsomn framework! This section will help you get started quickly.

Prerequisites

  • JDK 17+
  • Maven 3.8+
  • MySQL 8.0+
  • Redis 7.0+ (optional)

Add Dependency

xml
<dependency>
    <groupId>com.astrsomn</groupId>
    <artifactId>astrsomn-runtime-starter</artifactId>
    <version>0.2.0-SNAPSHOT</version>
</dependency>

Enable Framework

java
@EnableAstroRuntime
@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

Configure Model

yaml
astrsomn:
  models:
    - provider: DEEPSEEK
      api-key: sk-xxx
      base-url: https://api.deepseek.com/v1
      models:
        - name: deepseek-chat
          max-tokens: 8192
          temperature: 0.7

Create Agent

java
@Astro(name = "my-agent")
public class MyAgent {
    
    @AstroModel(provider = "DEEPSEEK", model = "deepseek-chat")
    private AstroClient client;
    
    @AstroPrompt("You are an intelligent assistant, answer questions in English")
    public String chat(String message) {
        return client.chat(message);
    }
}

Use Agent

java
@Autowired
private AgentService agentService;

public String askAgent(String message) {
    return agentService.chat("my-agent", message);
}

Next Steps