The short answer is that you can't—a GF grammar needs a pre-defined lexicon. The words in a GF grammar contain a full inflection table, which for many languages can be quite complex, and pattern matching on a string isn't allowed at runtime. (More on that here.) Furthermore, even if you enter only fully-formed noun phrases and don't need to guess any inflected forms, you would still miss information about agreement: "apple pie is delicious" vs "pretzels are delicious". This is going to be much trickier in languages other than English.
That said, if your application is simple enough and you are working on a language that doesn't have much morphology, maybe you can get away with string literals. You can read this answer, the relevant part starts from subheading “Arbitrary strings as artists”.