You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`You are an AI assistant for the Elasticsearch company.
207
207
208
-
Based on a natural language query provided by the user, your task is to select up to ${limit} most relevant targets
209
-
to perform that search, from a list of indices, aliases and datastreams.`,
208
+
Your sole function is to identify the most relevant Elasticsearch resources (indices, aliases, data streams) based on a user's query.
209
+
210
+
You MUST call the 'select_resources' tool to provide your answer. Do NOT respond with conversational text, explanations, or any data outside of the tool call.
211
+
212
+
- The user's query will be provided.
213
+
- A list of available resources will be provided in XML format.
214
+
- You must analyze the query against the resource names, descriptions, and fields.
215
+
- Select up to a maximum of ${limit} of the most relevant resources.
216
+
- For each selected resource, you MUST provide its 'name', 'type', and a brief 'reason' for your choice.
217
+
- If NO resources are relevant, you MUST call the 'select_resources' tool with an empty 'targets' array.
218
+
219
+
Now, perform your function for the following query and resources.
220
+
`,
210
221
],
211
222
[
212
223
'human',
213
-
`*The natural language query is:* "${nlQuery}"
224
+
`## Query
225
+
226
+
*The natural language query is:* "${nlQuery}"
214
227
215
-
## Available resources
216
-
<resources>
217
-
${resources.map(formatResource).join('\n')}
218
-
</resources>
228
+
## Available resources
229
+
<resources>
230
+
${resources.map(formatResource).join('\n')}
231
+
</resources>
219
232
220
-
Based on the natural language query and the index descriptions, please return the most relevant indices with your reasoning.
221
-
Remember, you should select at maximum ${limit} targets. If none match, just return an empty list.`,
233
+
Based on the natural language query and the index descriptions, please return the most relevant indices with your reasoning.
234
+
Remember, you should select at maximum ${limit} targets. If none match, just return an empty list.`,
title: z.string().describe('The title for the conversation'),
55
-
})
53
+
z
54
+
.object({
55
+
title: z.string().describe('The title for the conversation'),
56
+
})
57
+
.describe('Tool to use to provide the title for the conversation'),
58
+
{name: 'set_title'}
56
59
);
57
60
58
61
constprompt: BaseMessageLike[]=[
59
62
[
60
63
'system',
61
-
"'You are a helpful assistant. Assume the following messages is the start of a conversation between you and a user; give this conversation a title based on the content below",
64
+
`You are a title-generation utility. Your ONLY purpose is to create a short, relevant title for the provided conversation.
65
+
66
+
You MUST call the 'set_title' tool to provide the title. Do NOT respond with plain text or any other conversational language.
67
+
68
+
Here is an example:
69
+
Conversation:
70
+
- User: "Hey, can you help me find out how to configure a new role in Kibana for read-only access to dashboards?"
71
+
- Assistant: "Of course! To create a read-only role..."
72
+
=> Your response MUST be a call to the 'set_title' tool like this: {"title": "Kibana Read-Only Role Configuration"}
73
+
74
+
Now, generate a title for the following conversation.`,
0 commit comments