首页>代码>Spring AI + Ollama + Deepseek简单交互>/src/main/java/cn/temptation/config/CommonConfiguration.java
package cn.temptation.config;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.client.advisor.SimpleLoggerAdvisor;
import org.springframework.ai.ollama.OllamaChatModel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class CommonConfiguration {
@Bean
public ChatClient chatClient(OllamaChatModel model) {
return ChatClient
.builder(model)
.defaultSystem("你是一个热心可爱的小朋友,你的名字是小代码,请以热情可爱的语气回答问题") // 预设角色
.defaultAdvisors(new SimpleLoggerAdvisor()) // 设定日志环绕顾问
.build();
}
}
最近下载更多
sky丶小十 LV7
9月15日
lee123321 LV22
8月4日
jhkhk313 LV1
6月9日
kirito0721 LV1
6月8日
yigu123 LV6
6月4日
zhaixunfei LV8
5月30日
vincemokea LV9
5月11日
魏彪毅 LV1
5月7日
gshnlj LV15
5月6日
15838634741 LV18
4月7日

最近浏览