-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to Configure Model in Notebook #956
Comments
Feedback: The issue you're encountering arises from a potential mismatch between how the model is parsed and passed through different functions within the system. Your temporary workaround addresses the core problem by ensuring that the To ensure a more robust and maintainable solution, consider implementing a check to validate and apply the model setting consistently across all relevant functions. This could involve adding a default model in place of undefined values or handling cases where no model is explicitly set. Additionally, reviewing the Once these changes are made and tested thoroughly, ensure that they do not introduce new bugs or regressions. It might be a good idea to include comprehensive unit tests covering various scenarios of model configuration to validate future functionality.
|
At the same time, I found that when I try to use system prompts in the Notebook, it seems that they cannot be used either. Currently, I can modify the src/docsnotebook.ts file mentioned above to add:
Additionally, the runScriptInternal function in const prj = await buildProject({
toolFiles,
})
if (jsSource)
prj.scripts.push({
id: scriptId,
jsSource,
})
const script = prj.scripts.find(
(t) =>
t.id === scriptId ||
(t.filename &&
GENAI_ANY_REGEX.test(scriptId) &&
resolve(t.filename) === resolve(scriptId))
)
if (!script) throw new Error(`script ${scriptId} not found`)
const fragment: Fragment = {
files: Array.from(resolvedFiles),
} In the following section, add model and system: prj.scripts.push({
id: scriptId,
jsSource,
model: options.model,
system: options.system,
})
In the original code, the script for the current Notebook Cell was added to |
Thanks for digging. |
Version:
1.86.0
Description
When trying to configure a model in a Notebook through the
script({ model: 'some-model' })
in JS script cell or the page config YAML, the model configuration does not take effect.The Notebook still prompts that no model has been selected or defaults to the model configured in the
.env
file.During debugging, I found that in the
src/docsnotebook.ts
file, theactivateNotebookExecutor
function correctly parses the model from the meta (const meta = parsePromptScriptMeta(jsSource)
), but it seems that themeta.model
is not properly used as a parameter in the subsequentstartAIRequest
function insrc/state.ts
.To temporary resolve this, I manually modified the compiled JS file in the VS Code extension directory as follows:
After passing
model: template.model
in the third parameter, it seems to work as expected.The text was updated successfully, but these errors were encountered: