Update app.py
Browse files20 unmodified lines212223242526272829303132333435363738394016 unmodified lines5758596061626320 unmodified linesGEMINI_MODEL = "gemini-1.5-flash"system_message = """You are an assistant that reimplements Python code in high performance C++for an M1 Mac.""".strip()system_message += """Respond only with C++; use comments sparingly and do not provide anyexplanation other than occasion comments.""".strip()system_message += """The C++ response needs to produce an identical output in thefastest possible time.""".strip()current_time = datetime.now().strftime("%Y%m%d_%H:%M:%S")16 unmodified linesdef messages_for_python(python):return [{"role": "system", "content": system_message},{"role": "user", "content": user_prompt_for_python(python)}]20 unmodified lines212223242526272829303132333435363738394041424316 unmodified lines6061626364656620 unmodified linesGEMINI_MODEL = "gemini-1.5-flash"def system_message_for_python() -> str:system_message = """You are an assistant that reimplements Python code in high performance C++for an M1 Mac.""".strip()system_message += """Respond only with C++; use comments sparingly and do not provide anyexplanation other than occasion comments.""".strip()system_message += """The C++ response needs to produce an identical output in thefastest possible time.""".strip()return system_messagecurrent_time = datetime.now().strftime("%Y%m%d_%H:%M:%S")16 unmodified linesdef messages_for_python(python):return [{"role": "system", "content": system_message_for_python()},{"role": "user", "content": user_prompt_for_python(python)}]
app.py+16-13