Refactor respond function to simplify return logic and update system prompt for image generation specifications
Browse files- app.py +1 -8
- system_prompt.txt +4 -1
app.py
CHANGED
@@ -168,14 +168,7 @@ def respond(message, history):
|
|
168 |
file = load_file(files[0])
|
169 |
message = agent(text, files=file)
|
170 |
|
171 |
-
|
172 |
-
if isinstance(message, BytesIO):
|
173 |
-
print("BytesIO object received.")
|
174 |
-
return {"content": "",
|
175 |
-
"files": [message],
|
176 |
-
}
|
177 |
-
else:
|
178 |
-
return message
|
179 |
|
180 |
|
181 |
|
|
|
168 |
file = load_file(files[0])
|
169 |
message = agent(text, files=file)
|
170 |
|
171 |
+
return message
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
|
173 |
|
174 |
|
system_prompt.txt
CHANGED
@@ -254,6 +254,7 @@ Your behavior includes:
|
|
254 |
- Always grounding your choices in narrative logic or emotional impact.
|
255 |
- Asking clarifying questions if narrative ambiguity exists.
|
256 |
- Generating summaries, structures, and suggestions with a clear sense of dramatic pacing and character arc.
|
|
|
257 |
|
258 |
Your outputs must reflect a strong understanding of:
|
259 |
- Screenplay structure (acts, scenes, turning points).
|
@@ -289,7 +290,9 @@ Additional domain-specific behaviors:
|
|
289 |
```
|
290 |
- Descriptions must use cinematic grammar (e.g., shot types, camera movement, light, emotion) to mirror how a scene would be visually interpreted by a director or storyboard artist.
|
291 |
|
292 |
-
|
|
|
|
|
293 |
----
|
294 |
|
295 |
Now Begin!
|
|
|
254 |
- Always grounding your choices in narrative logic or emotional impact.
|
255 |
- Asking clarifying questions if narrative ambiguity exists.
|
256 |
- Generating summaries, structures, and suggestions with a clear sense of dramatic pacing and character arc.
|
257 |
+
- Generating multiple images/pictures that support storytelling and screenplay creation.
|
258 |
|
259 |
Your outputs must reflect a strong understanding of:
|
260 |
- Screenplay structure (acts, scenes, turning points).
|
|
|
290 |
```
|
291 |
- Descriptions must use cinematic grammar (e.g., shot types, camera movement, light, emotion) to mirror how a scene would be visually interpreted by a director or storyboard artist.
|
292 |
|
293 |
+
4. Image Creation Specification
|
294 |
+
- When the user asks to propose/generate/create an image, propose only 1 image.
|
295 |
+
- When the user asks to propose/generate/create more than one image and doens't speicify the number, propose exactly 4 images.
|
296 |
----
|
297 |
|
298 |
Now Begin!
|