Advice on Referencing Previous Prompts / Responses

When using Private Cloud Compute, I want to be able to submit more than one prompt per LanguageModelSession, ideally using the prompt and response from the first interaction to inform a second interaction. How can I reference this first prompt and response when making a subsequent prompt in a session? I have tried plain language like "current data" and "previous prompt" but it does not seem to understand.

That should work just fine. With any LanguageModelSession you can send it one prompt after another:

try await session.respond(to: "your first prompt")

then

try await session.respond(to: "then the next prompt")

This sounds like maybe a prompt engineering problem, if it's not doing what you want with the prior prompt.

If you're on macOS 27, I'd suggest playing with fm chat in the Terminal app, using the Private Cloud Compute model, to get a sense of what phrasing works well with this model.

In general, I'd also try plainer language... try talking to it a bit more casually like a person. E.g. instead of "previous prompt" try "previous question" or "previous request", instead of "current data" try "this current question/request" ... less machine-like phrasing.

Advice on Referencing Previous Prompts / Responses
 
 
Q