feat: init

This commit is contained in:
michael 2024-01-12 17:29:21 +08:00
parent 59f843d0c9
commit 679157d8e7
2 changed files with 44 additions and 0 deletions

View File

@ -26,6 +26,28 @@ use OpenAi LLM:
}
```
use Qwen LLM:
```java
public static void main(String[] args) throws InterruptedException {
QwenLlmConfig config = new QwenLlmConfig();
config.setApiKey("sk-28a6be3236****");
config.setModel("qwen-turbo");
Llm llm = new QwenLlm(config);
Prompt prompt = new SimplePrompt("Please write a story about a little rabbit defeating a big bad wolf");
llm.chat(prompt, (llmInstance, message) -> {
System.out.println("--->" + message.getContent());
});
Thread.sleep(10000);
}
```
use SparkAi LLM:
```java

View File

@ -27,6 +27,28 @@
}
```
使用 “通义千问” 大语言模型:
```java
public static void main(String[] args) throws InterruptedException {
QwenLlmConfig config = new QwenLlmConfig();
config.setApiKey("sk-28a6be3236****");
config.setModel("qwen-turbo");
Llm llm = new QwenLlm(config);
Prompt prompt = new SimplePrompt("请写一个关于小兔子战胜大灰狼的故事。");
llm.chat(prompt, (llmInstance, message) -> {
System.out.println("--->" + message.getContent());
});
Thread.sleep(10000);
}
```
使用 “讯飞星火” 大语言模型:
```java