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 a Project.
  • additional_context - An optional String that provides additional context for the retrieval operation.

§Returns

  • Result<ChatCompletionRequestMessage> - A Result that contains a ChatCompletionRequestMessage if the operation was successful, or an Err if it was not.