Function umm::grade::get_active_retrieval_context
source · pub fn get_active_retrieval_context(
proj: &Project,
active_retrieval_context: Option<String>
) -> Result<ChatCompletionRequestMessage>
Expand description
Retrieves the active context for a retrieval operation.
This function takes a reference to a Project
and an optional String
as
additional context. It ensures that the additional context is provided when
using active retrieval. It then prepares a series of
ChatCompletionRequestMessage
and serializes them into a JSON string.
§Arguments
proj
- A reference to aProject
.additional_context
- An optionalString
that provides additional context for the retrieval operation.
§Returns
Result<ChatCompletionRequestMessage>
- AResult
that contains aChatCompletionRequestMessage
if the operation was successful, or anErr
if it was not.