Skip to content

Commit 1a871f1

Browse files
committed
better instructions for checking candidate neurons
1 parent e7212e3 commit 1a871f1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

app/api/chat/route.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2229,8 +2229,8 @@ async function executeFunctionTool(name, args, context = {}) {
22292229
return JSON.stringify({
22302230
requires_user_selection: true,
22312231
tool: 'vfb_query_connectivity',
2232-
message: 'vfb_query_connectivity requires neuron class inputs. One or more provided terms do not have both Neuron and Class in SuperTypes.',
2233-
instruction: 'Ask the user to choose one neuron class from each side before running connectivity.',
2232+
message: 'One or more terms are not neuron classes. The candidates below were already retrieved by the server — do NOT re-run NeuronsPartHere or any other query yourself.',
2233+
instruction: 'Present the candidate neuron classes to the user and ask them to pick which one(s) to use. Do NOT attempt additional tool calls to work around this — just show the candidates and ask.',
22342234
selections_needed: selectionsNeeded
22352235
})
22362236
}
@@ -2658,7 +2658,7 @@ TOOL SELECTION:
26582658
- Questions about FlyBase genes/alleles/insertions/stocks: use vfb_resolve_entity first (if unresolved), then vfb_find_stocks
26592659
- Questions about split-GAL4 combination names/synonyms (for example MB002B, SS04495): use vfb_resolve_combination first, then vfb_find_combo_publications (and optionally vfb_find_stocks if the user asks for lines)
26602660
- Questions about comparative connectivity between neuron classes across datasets: use vfb_query_connectivity (optionally vfb_list_connectome_datasets first to pick valid dataset symbols)
2661-
- For connectivity questions, call vfb_query_connectivity directly with the FULL neuron class labels or FBbt IDs the user mentions — do NOT manually run NeuronsPartHere or vfb_search_terms first. The server handles term resolution and will return requires_user_selection if disambiguation is needed.
2661+
- For connectivity questions, call vfb_query_connectivity directly with the FULL neuron class labels or FBbt IDs the user mentions — do NOT manually run NeuronsPartHere, vfb_run_query, or vfb_search_terms first. The server handles term resolution internally and will return requires_user_selection if disambiguation is needed. If you receive a requires_user_selection response, present the candidates to the user — do NOT attempt additional tool calls to work around it.
26622662
- IMPORTANT: When the user gives a multi-word neuron name like "adult ellipsoid body ring neuron", pass the ENTIRE phrase as the label. Do NOT break it into sub-terms (e.g. do NOT search for "ellipsoid body" separately). Always use the longest, most specific term the user provides.
26632663
- For directional requests like "connections from X to Y" or "between X and Y", treat X as upstream (presynaptic) and Y as downstream (postsynaptic), and prefer vfb_query_connectivity over a single-term run_query.
26642664
- Do not infer identity from examples in this prompt. Only map IDs to labels (or labels to IDs) using tool outputs from this turn.
@@ -2667,7 +2667,7 @@ TOOL SELECTION:
26672667
- Questions about VFB, NeuroFly, VFB Connect Python documentation, or approved FlyBase documentation pages, news posts, workshops, conference pages, or event dates: use search_reviewed_docs, then use get_reviewed_page when you need page details
26682668
- For questions about how to run VFB queries in Python or how to use vfb-connect, prioritize search_reviewed_docs/get_reviewed_page on vfb-connect.readthedocs.io alongside VFB tool outputs when useful.
26692669
- For connectivity, synaptic, or NBLAST questions, and especially when the user explicitly asks for vfb_run_query, do not search PubMed or reviewed-docs first; use VFB tools (vfb_search_terms/vfb_get_term_info/vfb_run_query). Use vfb_query_connectivity when the user asks for class-to-class connectivity comparisons across datasets.
2670-
- If vfb_query_connectivity returns requires_user_selection: true, do not claim connectivity results. Show the candidate neuron classes and ask the user which upstream/downstream classes to use.
2670+
- CRITICAL: If vfb_query_connectivity returns requires_user_selection: true, this means the backend already resolved the term and found it is not a neuron class. Do NOT re-run NeuronsPartHere, vfb_run_query, or vfb_search_terms yourself — the backend already did this work. Instead: (1) clearly explain that the term the user gave is an anatomy region / neuron type, not a neuron class; (2) show the candidate neuron classes from the "candidates" array in the response; (3) ask the user to pick which neuron class(es) to use for the connectivity query. If the candidates array is empty, suggest the user try a more specific neuron class name.
26712671
- When connectivity relationships would be easier to understand visually, you may call create_basic_graph with key nodes and weighted edges.
26722672
- Do not attempt general web search or browsing outside the approved reviewed-doc index
26732673

0 commit comments

Comments
 (0)