初始化
This commit is contained in:
39
easy-agents-samples/easy-agents-helloworld/.gitignore
vendored
Normal file
39
easy-agents-samples/easy-agents-helloworld/.gitignore
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
.kotlin
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
.idea/libraries/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
||||
25
easy-agents-samples/easy-agents-helloworld/pom.xml
Normal file
25
easy-agents-samples/easy-agents-helloworld/pom.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.easyagents</groupId>
|
||||
<artifactId>easy-agents-helloworld</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.easyagents</groupId>
|
||||
<artifactId>easy-agents-bom</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.easyagents;
|
||||
|
||||
import com.easyagents.llm.openai.OpenAIChatConfig;
|
||||
import com.easyagents.llm.openai.OpenAIChatModel;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
|
||||
OpenAIChatModel chatModel = OpenAIChatConfig.builder()
|
||||
.provider("GiteeAI")
|
||||
.endpoint("https://ai.gitee.com")
|
||||
.requestPath("/v1/chat/completions")
|
||||
.apiKey("P****QL7D12")
|
||||
.model("Qwen3-32B")
|
||||
.buildModel();
|
||||
|
||||
String output = chatModel.chat("如何才能更幽默?");
|
||||
System.out.println(output);
|
||||
}
|
||||
}
|
||||
3
easy-agents-samples/readme.md
Normal file
3
easy-agents-samples/readme.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Easy-Agents 示例代码
|
||||
|
||||
建议从 hello world 开始
|
||||
Reference in New Issue
Block a user