| Components | All | New | MacOS | Windows | Linux | iOS | ||||
| Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old | |
FoundationModels.Respond
Produces a response to a prompt.
| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
| FoundationModels | 15.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |
MBS( "FoundationModels.Respond"; FoundationModel; Text ) More
Parameters
| Parameter | Description | Example |
|---|---|---|
| FoundationModel | The identifier for the model. | $model |
| Text | The text to send to the LLM. | "What is five plus three?" |
Result
Returns text or error.
Description
Produces a response to a prompt.We wait for the answer and return it.
If temperature >= 0 or maximumResponseTokens >= 0, we pass these as options.
Examples
Summarize text:
Set Variable [ $session ; Value: MBS("FoundationModels.Initialize"; "General"; "PermissiveContentTransformations") ]
Set Variable [ $r ; Value: MBS("FoundationModels.BeginSession"; $session; "Summarize the following text in 100 words.") ]
#
# now ask the model for an answer, which may take a few seconds
Set Variable [ $answer ; Value: MBS("FoundationModels.Respond"; $session; Summarize::Text to Summerize) ]
#
# store answer
Set Field [ Summarize::Summary ; $answer ]
Commit Records/Requests [ With dialog: Off ]
#
Set Variable [ $r ; Value: MBS("FoundationModels.Release"; $session) ]
Set Variable [ $r ; Value: MBS("FoundationModels.BeginSession"; $session; "Summarize the following text in 100 words.") ]
#
# now ask the model for an answer, which may take a few seconds
Set Variable [ $answer ; Value: MBS("FoundationModels.Respond"; $session; Summarize::Text to Summerize) ]
#
# store answer
Set Field [ Summarize::Summary ; $answer ]
Commit Records/Requests [ With dialog: Off ]
#
Set Variable [ $r ; Value: MBS("FoundationModels.Release"; $session) ]
See also
- FoundationModels.BeginSession
- FoundationModels.Initialize
- FoundationModels.List
- FoundationModels.Prewarm
- FoundationModels.Release
- FoundationModels.ReleaseAll
Blog Entries
This function checks for a license.
Created 26th September 2025, last changed 27th September 2025
FoundationModels.ReleaseAll - FoundationModels.SetMaximumResponseTokens