yangtuooc

Results 12 comments of yangtuooc

After the server restarts, it loses all session states, but the client is still using its old session ID. This causes ‘session not found’ errors. Here is the relevant code...

> > 不起作用的具体情况是什么? > > 不能正常流式输出,只能一次性返回 这似乎是Ollama的问题,参见:https://github.com/ollama/ollama/issues/9946

> Thanks. Will investigate. We do have a streaming test with ollama in `OllamaChatModelFunctionCallingIT` but it isn't going through ChatClient, it is using the OllamaChatModel directly. > > what model...

> Thanks. Will investigate. We do have a streaming test with ollama in `OllamaChatModelFunctionCallingIT` but it isn't going through ChatClient, it is using the OllamaChatModel directly. > > what model...

1. 工具调用的返回结果必须是一个JSON字符串 2. 默认情况下会使用Jackson进行序列化 因此,在这段代码中你可以直接返回一个类对象或者Map对象 ```java @Tool(description = "根据城市ID获取天气") public Map getWeatherForecastDistrictId(@ToolParam(description = "城市Id") String districtId) { return restClient.get() .uri(new BaiDuTools().getSn(districtId)) .retrieve() .body(Map.class); } ``` 另外,你可以参考官方的文档,有明确的关于工具调用结果转换的说明:https://docs.spring.io/spring-ai/reference/api/tools.html#_result_conversion

> 多谢答复。 但是同样的Server在Cherry Studio和Cline里使用都是正常的,我还是认为这是Spring AI的一个Bug 这是不同框架在设计层面上约束的差异,不算严格意义上的Bug

> > 1. 工具调用的返回结果必须是一个JSON字符串 > > 2. 默认情况下会使用Jackson进行序列化 > > > > 因此,在这段代码中你可以直接返回一个类对象或者Map对象 > > [@tool](https://github.com/tool)(description = "根据城市ID获取天气") > > public Map getWeatherForecastDistrictId(@ToolParam(description = "城市Id") String districtId) { > >...

> > > > 1. 工具调用的返回结果必须是一个JSON字符串 > > > > 2. 默认情况下会使用Jackson进行序列化 > > > > > > > > 因此,在这段代码中你可以直接返回一个类对象或者Map对象 > > > > [@tool](https://github.com/tool)(description = "根据城市ID获取天气") > >...