Spaces:
Runtime error
Runtime error
Create prompt.py
Browse files
prompt.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def create_prompt(query: str) -> str:
|
| 2 |
+
"""
|
| 3 |
+
Creates a structured prompt for the Gemini model.
|
| 4 |
+
|
| 5 |
+
Args:
|
| 6 |
+
query: The user's query.
|
| 7 |
+
|
| 8 |
+
Returns:
|
| 9 |
+
A formatted prompt string.
|
| 10 |
+
"""
|
| 11 |
+
# You can customize this prompt to guide the model's responses.
|
| 12 |
+
# For example, you can add a persona, context, or few-shot examples.
|
| 13 |
+
prompt = f"""
|
| 14 |
+
You are a helpful and friendly assistant.
|
| 15 |
+
|
| 16 |
+
User query: {query}
|
| 17 |
+
|
| 18 |
+
Please provide a concise and accurate response.
|
| 19 |
+
"""
|
| 20 |
+
return prompt
|