Add roles/home/aichat/roles/documentfunction.md

This commit is contained in:
Giulio De Pasquale 2025-01-21 17:33:31 +00:00
parent 1443282f8f
commit b9dc684c3f

View File

@ -0,0 +1,17 @@
// ReplaceAllRequestParameters generates a new set of requests by replacing each parameter's value with the provided payload.
//
// This function iterates over all parameters in the given request and creates a new request for each parameter,
// replacing its value with the specified payload. The resulting requests are returned as a slice, leaving the original
// request unmodified.
//
// Parameters:
// - req (models.CrawlRequest): The original CrawlRequest containing parameters to be processed.
// - payload (string): The value to replace each parameter's value.
//
// Returns:
// - ([]models.CrawlRequest): A slice of new CrawlRequest instances, each with one parameter's value replaced by the payload.
// - (error): An error if any issue occurs during processing.
//
// Notes:
// - A new request is created for every parameter in the original request.
// - The function is side-effect free and does not modify the original `CrawlRequest`.