Handling Full Context Windows

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

Handling Full Context Windows

One of the errors you handled with a specific case when building the app in the first lesson was for exceeding the maximum context window length. The context window is the maximum number of tokens that the model can consider simultaneously. When you changed the app in the last lesson to use a single LanguageModelSession, all the prompts and responses formed a single context window. This context window is how the model references the fruits from one response in a later prompt in the last lesson. Anything not in the context window must be embedded in the model or added using other methods, such as Retrieval Augmented Generation (RAG), which is not directly supported in the initial version of Foundation Models.

Onjeixivy jxi lulecok dihkiqf wipcac dipmsh.
Uwneirimb kpe nuxumil cesgesx zokbep yuntbf.

Kvo dayvunufum payz
Kma ridnegezit suml

See forum comments
Download course materials from Github
Previous: Foundation Model Options & Tuning Next: Conclusion