В Spring.ai 1.0.0-Snapshot Почему я получаю неизвестный параметр: 'response_format.schemaJAVA

Программисты JAVA общаются здесь
Anonymous
В Spring.ai 1.0.0-Snapshot Почему я получаю неизвестный параметр: 'response_format.schema

Сообщение Anonymous »

https://docs.spring.io/spring-ai/refere ... -chat.html
https://spring.io/blog/2024/08/09/sprin ... on-respons Для Spring.ai для структурированных выходов с открытым ИИ. Однако всякий раз, когда я пытаюсь сделать запрос, я продолжаю получать < /p>

Неизвестный параметр: 'response_format.schema, < /p>
< /blockquote>
Даже если я копирую и вставляю код, предоставленный в документации, и я использую ту же версию, что и в документации. Я прикреплю свои файлы pom.xml и свое приложение. Прозрачные и мою конечную точку.
IVe приложила ошибку запроса почтальника внизу < /p>
Документация по настройке с помощью свойств приложения < /p>
Документация на openai чат < /p>
@RestController
class AiController {
private final ChatClient chatClient;

public AiController(ChatClient.Builder chatClientBuilder) {
this.chatClient = chatClientBuilder.build();
}

@PostMapping("/ai")
String generation(@RequestParam String request) {
return this.chatClient.prompt()
.user(request)
.call()
.content();
}
}

application.properties
spring.application.name=p4p

spring.ai.openai.api-key=API-KEY
spring.ai.openai.chat.options.model=gpt-4o-mini

spring.ai.openai.chat.options.responseFormat.type=JSON_SCHEMA
spring.ai.openai.chat.options.responseFormat.name=MySchemaName
spring.ai.openai.chat.options.responseFormat.schema={"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{"explanation":{"type":"string"},"output":{"type":"string"}},"required":["explanation","output"],"additionalProperties":false}},"final_answer":{"type":"string"}},"required":["steps","final_answer"],"additionalProperties":false}
spring.ai.openai.chat.options.responseFormat.strict=true

pom.xml

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0

org.springframework.boot
spring-boot-starter-parent
3.4.5


Подробнее здесь: https://stackoverflow.com/questions/796 ... nse-format

Вернуться в «JAVA»