Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
This commit is contained in:
Tran Ngoc Nhan
2025-05-22 13:41:08 +07:00
committed by GitHub
parent b6f29a493f
commit 0880d17182
3 changed files with 12 additions and 12 deletions

View File

@@ -302,7 +302,7 @@ TIP: You can pass multiple audio files as well.
OpenAI models that offer input audio multimodal support include `gpt-4o-audio-preview`.
Refer to the link:https://platform.openai.com/docs/guides/audio[Audio] guide for more information.
The OpenAI link:https://platform.openai.com/docs/api-reference/chat/create#chat-create-messages[Assystant Message API] can contain a list of base64-encoded audio files with the message.
The OpenAI link:https://platform.openai.com/docs/api-reference/chat/create#chat-create-messages[Assistant Message API] can contain a list of base64-encoded audio files with the message.
Spring AIs link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-model/src/main/java/org/springframework/ai/chat/messages/Message.java[Message] interface facilitates multimodal AI models by introducing the link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-model/src/main/java/org/springframework/ai/chat/messages/Media.java[Media] type.
This type encompasses data and details regarding media attachments in messages, utilizing Springs `org.springframework.util.MimeType` and a `org.springframework.core.io.Resource` for the raw media data.
Currently, OpenAI support only the following audio types: `audio/mp3` and `audio/wav`.
@@ -325,12 +325,12 @@ String text = response.getResult().getOutput().getContent(); // audio transcript
byte[] waveAudio = response.getResult().getOutput().getMedia().get(0).getDataAsByteArray(); // audio data
----
You have to specify an `audio` modality in the `OpenAiChatOptions` to generate audio output.
You have to specify an `audio` modality in the `OpenAiChatOptions` to generate audio output.
The `AudioParameters` class provides the voice and audio format for the audio output.
== Structured Outputs
OpenAI provides custom https://platform.openai.com/docs/guides/structured-outputs[Structured Outputs] APIs that ensure your model generates responses conforming strictly to your provided `JSON Schema`.
OpenAI provides custom https://platform.openai.com/docs/guides/structured-outputs[Structured Outputs] APIs that ensure your model generates responses conforming strictly to your provided `JSON Schema`.
In addition to the existing Spring AI model-agnostic xref::api/structured-output-converter.adoc[Structured Output Converter], these APIs offer enhanced control and precision.
NOTE: Currently, OpenAI supports a link:https://platform.openai.com/docs/guides/structured-outputs/supported-schemas[subset of the JSON Schema language] format.

View File

@@ -103,19 +103,19 @@ All properties are prefixed with `spring.ai.mcp.server`:
|`tool-response-mime-type` |(optional) response MIME type per tool name. For example `spring.ai.mcp.server.tool-response-mime-type.generateImage=image/png` will associate the `image/png` mime type with the `generateImage()` tool name |`-`
|`sse-message-endpoint` | Custom SSE Message endpoint path for web transport to be used by the client to send messages|`/mcp/message`
|`sse-endpoint` |Custom SSE endpoint path for web transport |`/sse`
|`base-url` | Optional URL prefix. For example `base-url=/api/v1` means that the client should access the sse endpont at `/api/v1` + `sse-endpoint` and the message endpoint is `/api/v1` + `sse-message-endpoint` | -
|`base-url` | Optional URL prefix. For example `base-url=/api/v1` means that the client should access the sse endpoint at `/api/v1` + `sse-endpoint` and the message endpoint is `/api/v1` + `sse-message-endpoint` | -
|`request-timeout` | Duration to wait for server responses before timing out requests. Applies to all requests made through the client, including tool calls, resource access, and prompt operations. | `20` seconds
|===
== Sync/Async Server Types
* **Synchronous Server** - The default server type implemented using `McpSyncServer`.
It is designed for straightforward request-response patterns in your applications.
To enable this server type, set `spring.ai.mcp.server.type=SYNC` in your configuration.
* **Synchronous Server** - The default server type implemented using `McpSyncServer`.
It is designed for straightforward request-response patterns in your applications.
To enable this server type, set `spring.ai.mcp.server.type=SYNC` in your configuration.
When activated, it automatically handles the configuration of synchronous tool specifications.
* **Asynchronous Server** - The asynchronous server implementation uses `McpAsyncServer` and is optimized for non-blocking operations.
To enable this server type, configure your application with `spring.ai.mcp.server.type=ASYNC`.
* **Asynchronous Server** - The asynchronous server implementation uses `McpAsyncServer` and is optimized for non-blocking operations.
To enable this server type, configure your application with `spring.ai.mcp.server.type=ASYNC`.
This server type automatically sets up asynchronous tool specifications with built-in Project Reactor support.
== Server Capabilities
@@ -250,7 +250,7 @@ Provides a standardized way for servers to expose completion capabilities to cli
@Bean
public List<McpServerFeatures.SyncCompletionSpecification> myCompletions() {
var completion = new McpServerFeatures.SyncCompletionSpecification(
"code-completion",
"code-completion",
"Provides code completion suggestions",
(exchange, request) -> {
// Implementation that returns completion suggestions
@@ -260,7 +260,7 @@ public List<McpServerFeatures.SyncCompletionSpecification> myCompletions() {
));
}
);
return List.of(completion);
}
----

View File

@@ -109,7 +109,7 @@ class WeatherTools {
}
----
And you can use the same `ChatClient#tools()` API to register method-based tool callbackes:
And you can use the same `ChatClient#tools()` API to register method-based tool callbacks:
[source,java]
----