-
Notifications
You must be signed in to change notification settings - Fork 108
assistant: ensure variables are included in context and tool calls #8643
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
Conversation
if the access keys are not specified, are empty, or only contain empty arrays, do the all vars list
E2E Tests 🚀 |
@@ -329,7 +329,7 @@ | |||
{ | |||
"name": "inspectVariables", | |||
"displayName": "Inspect Variables", | |||
"modelDescription": "List the children of an array of variables in a session. For example, the columns in a dataframe, items in a column or array, or elements of a list. If `accessKeys` is empty, lists all root-level variables in the session.\n\nIf the user references a variable by name, first determine the `access_key` from the user context or a previous inspect variables result.\n\nDo not call when:\n - the variables do not appear in the user context\n - there is no session (the session identifier is empty or not defined)", | |||
"modelDescription": "List the children of an array of variables in a session. For example, the columns in a dataframe, items in a column or array, or elements of a list. If `accessKeys` is empty, lists all root-level variables in the session.\n\nIf the user references a variable by name, first determine the `access_key` from the user context or a previous inspect variables result.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- removed
Do not call when: the variables do not appear in the user context
since this didn't seem to be respected by the models anyways - removed
Do not call when: there is no session (the session identifier is empty or not defined)
since it is covered in Assistant: Don't provide tools to models in invalid contexts #8078
let sessionContent = sessionSummary; | ||
if (value.variables) { | ||
// Include the session variables in the session content. | ||
const variablesSummary = JSON.stringify(value.variables, null, 2); | ||
sessionContent += '\n' + xml.node('variables', variablesSummary); | ||
} | ||
sessionPrompts.push(xml.node('session', sessionContent)); | ||
log.debug(`[context] adding session context for session ${value.activeSession.identifier}: ${sessionContent.length} characters`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ensure we are pushing variables info into the session context
const accessKeysProvided = !!accessKeys && accessKeys.length > 0 && accessKeys.some(key => key.length !== 0); | ||
if (accessKeysProvided) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ensure there is at least one access key for inspection, otherwise list all variables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
Release Notes
Bug Fixes
QA Notes
@:assistant
See #8641 and #8642 -- thanks for the repro steps!