@@ -96,6 +96,7 @@ import TextView from "@/components/chat/TextView";
96
96
import { MinimalOnyxDocument } from "@/lib/search/interfaces" ;
97
97
import { MAX_CHARACTERS_PERSONA_DESCRIPTION } from "@/lib/constants" ;
98
98
import { FormErrorFocus } from "@/components/FormErrorHelpers" ;
99
+ import { useAgentsContext } from "@/components-2/context/AgentsContext" ;
99
100
100
101
function findSearchTool ( tools : ToolSnapshot [ ] ) {
101
102
return tools . find ( ( tool ) => tool . in_code_tool_id === SEARCH_TOOL_ID ) ;
@@ -122,6 +123,17 @@ function SubLabel({ children }: { children: string | JSX.Element }) {
122
123
) ;
123
124
}
124
125
126
+ interface AssistantEditorProps {
127
+ existingPersona ?: FullPersona | null ;
128
+ ccPairs : CCPairBasicInfo [ ] ;
129
+ documentSets : DocumentSetSummary [ ] ;
130
+ user : User | null ;
131
+ defaultPublic : boolean ;
132
+ llmProviders : LLMProviderView [ ] ;
133
+ tools : ToolSnapshot [ ] ;
134
+ shouldAddAssistantToUserPreferences ?: boolean ;
135
+ }
136
+
125
137
export function AssistantEditor ( {
126
138
existingPersona,
127
139
ccPairs,
@@ -131,17 +143,9 @@ export function AssistantEditor({
131
143
llmProviders,
132
144
tools,
133
145
shouldAddAssistantToUserPreferences,
134
- } : {
135
- existingPersona ?: FullPersona | null ;
136
- ccPairs : CCPairBasicInfo [ ] ;
137
- documentSets : DocumentSetSummary [ ] ;
138
- user : User | null ;
139
- defaultPublic : boolean ;
140
- llmProviders : LLMProviderView [ ] ;
141
- tools : ToolSnapshot [ ] ;
142
- shouldAddAssistantToUserPreferences ?: boolean ;
143
- } ) {
144
- const { refreshAssistants } = useAssistantsContext ( ) ;
146
+ } : AssistantEditorProps ) {
147
+ // const { refreshAssistants } = useAssistantsContext();
148
+ const { refreshAgents } = useAgentsContext ( ) ;
145
149
146
150
const router = useRouter ( ) ;
147
151
const searchParams = useSearchParams ( ) ;
@@ -452,7 +456,7 @@ export function AssistantEditor({
452
456
if ( existingPersona ) {
453
457
const response = await deletePersona ( existingPersona . id ) ;
454
458
if ( response . ok ) {
455
- await refreshAssistants ( ) ;
459
+ await refreshAgents ( ) ;
456
460
router . push (
457
461
isAdminPage ? `/admin/assistants?u=${ Date . now ( ) } ` : `/chat`
458
462
) ;
@@ -703,7 +707,7 @@ export function AssistantEditor({
703
707
message : `"${ assistant . name } " has been added to your list.` ,
704
708
type : "success" ,
705
709
} ) ;
706
- await refreshAssistants ( ) ;
710
+ await refreshAgents ( ) ;
707
711
} else {
708
712
setPopup ( {
709
713
message : `"${ assistant . name } " could not be added to your list.` ,
@@ -712,7 +716,7 @@ export function AssistantEditor({
712
716
}
713
717
}
714
718
715
- await refreshAssistants ( ) ;
719
+ await refreshAgents ( ) ;
716
720
await refreshFolders ( ) ;
717
721
718
722
router . push (
@@ -787,7 +791,7 @@ export function AssistantEditor({
787
791
Edit assistant < b > { existingPersona . name } </ b >
788
792
</ >
789
793
) : (
790
- "Create an Assistant "
794
+ "Create an Agent "
791
795
) }
792
796
</ p >
793
797
< div className = "max-w-4xl w-full" >
0 commit comments