Text variables instead a file in input to knowledge retrieval Assistant?

Hi,

i want to create a OpenAI Assistant via python with knowledge retrieval tool, but instead loading local files i would like to upload directly long sentences/texts that i have in memory in variables. Is it possible?

Thanks,
Matteo