include_file {codestral} | R Documentation |
Read and include files in a prompt
Description
Read and include files in a prompt
Usage
include_file(prompt, anyFile)
Arguments
prompt |
A vector of strings. |
anyFile |
A boolean of the same length of prompt indicating that an instruction |
Details
If anyFile[i]
is TRUE
then the sequence of characters following the instruction "ff:"
in prompt[i]
is read until the next space or the end of the string. This extracted string is assumed to be a file name. This file is looked for in the current working directory or any of its sub-directories. Once detected, the file is read with readLines()
and this content is inserted in prompt
between prompt[i-1]
and prompt[i+1]
. Note that prompt[i]
is therefore deleted.
The result is returned.
Value
A vector of strings containing prompt augmented by the files refered to in the original prompt.
[Package codestral version 0.0.1 Index]