Class RestChannel
java.lang.Object
ai.yda.framework.channel.rest.spring.web.RestChannel
- All Implemented Interfaces:
ai.yda.framework.channel.core.Channel<ai.yda.framework.rag.core.model.RagRequest,ai.yda.framework.rag.core.model.RagResponse>
@RestController
@RequestMapping(path="${ai.yda.framework.channel.rest.spring.endpoint-relative-path:/}")
public class RestChannel
extends Object
implements ai.yda.framework.channel.core.Channel<ai.yda.framework.rag.core.model.RagRequest,ai.yda.framework.rag.core.model.RagResponse>
Provides REST controller logic that handles incoming requests for processing using an assistant. The path of the
endpoint is configurable via properties, allowing for flexibility in deployment.
- Since:
- 0.1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRestChannel(ai.yda.framework.core.assistant.Assistant<ai.yda.framework.rag.core.model.RagRequest, ai.yda.framework.rag.core.model.RagResponse> assistant) Constructs a newRestChannelinstance with the specifiedAssistantinstance. -
Method Summary
Modifier and TypeMethodDescriptionai.yda.framework.rag.core.model.RagResponseprocessRequest(ai.yda.framework.rag.core.model.RagRequest ragRequest) Processes the incomingRagRequestby delegating it to theAssistant.
-
Constructor Details
-
RestChannel
public RestChannel(ai.yda.framework.core.assistant.Assistant<ai.yda.framework.rag.core.model.RagRequest, ai.yda.framework.rag.core.model.RagResponse> assistant) Constructs a newRestChannelinstance with the specifiedAssistantinstance.- Parameters:
assistant- theAssistantinstance used to processRagRequestand generateRagResponse.
-
-
Method Details
-
processRequest
@PostMapping public ai.yda.framework.rag.core.model.RagResponse processRequest(@RequestBody @Validated ai.yda.framework.rag.core.model.RagRequest ragRequest) Processes the incomingRagRequestby delegating it to theAssistant.This method is mapped to the HTTP POST method and handles the logic for processing a validated
RagRequest. The request is passed to the assistant, which performs the necessary operations to generate aRagResponse.- Specified by:
processRequestin interfaceai.yda.framework.channel.core.Channel<ai.yda.framework.rag.core.model.RagRequest,ai.yda.framework.rag.core.model.RagResponse> - Parameters:
ragRequest- theRagRequestobject containing the data to be processed.- Returns:
- the
RagResponseobject generated by the assistant.
-