Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -48,17 +48,8 @@ def query_generator(user_input:str) -> str:
|
|
48 |
completion = client.chat.completions.create(
|
49 |
model=response.fine_tuned_model,
|
50 |
messages=[
|
51 |
-
{"role": "system", "content": """You are a highly skilled assistant trained to translate natural language requests
|
52 |
-
|
53 |
-
Understand the user's request by breaking it down into components such as filters, aggregations, sort criteria, and specific fields.
|
54 |
-
Pay special attention to fields with unique names, such as Date (instead of timestamp) and Stream (instead of type), and ensure they are used correctly in the query.
|
55 |
-
Recognize that the user operates within two main opcos: Zambia and Eswatini, each containing ptm_counters, ptm_events, and multiple streams like ers-daily.
|
56 |
-
Generate a valid JSON query strictly based on the provided indices, ensuring it aligns with the user's prompt.
|
57 |
-
When generating the query:
|
58 |
-
Be precise and include only necessary fields and components relevant to the request.
|
59 |
-
Assume any unspecified context or detail needs clarification and provide a clear explanation of your assumptions if needed.
|
60 |
-
Optimize the query for OpenSearch performance and readability.
|
61 |
-
Your goal is to provide a query that directly addresses the user's needs while being efficient and valid within the OpenSearch framework."""
|
62 |
|
63 |
},
|
64 |
{"role": "user", "content": user_input}
|
|
|
48 |
completion = client.chat.completions.create(
|
49 |
model=response.fine_tuned_model,
|
50 |
messages=[
|
51 |
+
{"role": "system", "content": """don't add any other text to sql query;You are a highly skilled assistant trained to translate natural language requests
|
52 |
+
into accurate and efficient OpenSearch JSON queries """
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
},
|
55 |
{"role": "user", "content": user_input}
|