Gilberto Medrano commited on
Commit
24ca624
·
1 Parent(s): 181e273

Added files for React-focused prompt objects

Browse files
Files changed (6) hide show
  1. .DS_Store +0 -0
  2. .chainlit/config.toml +84 -0
  3. app.py +30 -5
  4. chainlit.md +9 -2
  5. public/gpt_avatar.webp +0 -0
  6. public/stylesheet.css +152 -0
.DS_Store ADDED
Binary file (6.15 kB). View file
 
.chainlit/config.toml ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [project]
2
+ # Whether to enable telemetry (default: true). No personal data is collected.
3
+ enable_telemetry = true
4
+
5
+ # List of environment variables to be provided by each user to use the app.
6
+ user_env = []
7
+
8
+ # Duration (in seconds) during which the session is saved when the connection is lost
9
+ session_timeout = 3600
10
+
11
+ # Enable third parties caching (e.g LangChain cache)
12
+ cache = false
13
+
14
+ # Follow symlink for asset mount (see https://github.com/Chainlit/chainlit/issues/317)
15
+ # follow_symlink = false
16
+
17
+ [features]
18
+ # Show the prompt playground
19
+ prompt_playground = true
20
+
21
+ # Process and display HTML in messages. This can be a security risk (see https://stackoverflow.com/questions/19603097/why-is-it-dangerous-to-render-user-generated-html-or-javascript)
22
+ unsafe_allow_html = false
23
+
24
+ # Process and display mathematical expressions. This can clash with "$" characters in messages.
25
+ latex = false
26
+
27
+ # Authorize users to upload files with messages
28
+ multi_modal = true
29
+
30
+ # Allows user to use speech to text
31
+ [features.speech_to_text]
32
+ enabled = false
33
+ # See all languages here https://github.com/JamesBrill/react-speech-recognition/blob/HEAD/docs/API.md#language-string
34
+ # language = "en-US"
35
+
36
+ [UI]
37
+ # Name of the app and chatbot.
38
+ name = "Chatbot"
39
+
40
+ # Show the readme while the conversation is empty.
41
+ show_readme_as_default = true
42
+
43
+ # Description of the app and chatbot. This is used for HTML tags.
44
+ # description = ""
45
+
46
+ # Large size content are by default collapsed for a cleaner ui
47
+ default_collapse_content = true
48
+
49
+ # The default value for the expand messages settings.
50
+ default_expand_messages = false
51
+
52
+ # Hide the chain of thought details from the user in the UI.
53
+ hide_cot = false
54
+
55
+ # Link to your github repo. This will add a github button in the UI's header.
56
+ # github = ""
57
+
58
+ # Specify a CSS file that can be used to customize the user interface.
59
+ # The CSS file can be served from the public directory or via an external link.
60
+ custom_css = "/public/stylesheet.css"
61
+
62
+ # Override default MUI light theme. (Check theme.ts)
63
+ [UI.theme.light]
64
+ #background = "#FAFAFA"
65
+ #paper = "#FFFFFF"
66
+
67
+ [UI.theme.light.primary]
68
+ #main = "#F80061"
69
+ #dark = "#980039"
70
+ #light = "#FFE7EB"
71
+
72
+ # Override default MUI dark theme. (Check theme.ts)
73
+ [UI.theme.dark]
74
+ #background = "#FAFAFA"
75
+ #paper = "#FFFFFF"
76
+
77
+ [UI.theme.dark.primary]
78
+ #main = "#F80061"
79
+ #dark = "#980039"
80
+ #light = "#FFE7EB"
81
+
82
+
83
+ [meta]
84
+ generated_by = "0.7.700"
app.py CHANGED
@@ -11,18 +11,43 @@ from dotenv import load_dotenv
11
  load_dotenv()
12
 
13
  # ChatOpenAI Templates
14
- system_template = """You are a helpful assistant who always speaks in a pleasant tone!
 
 
 
 
 
 
 
 
 
 
 
 
15
  """
16
 
17
- user_template = """{input}
18
- Think through your response step by step.
19
- """
 
 
 
 
20
 
 
 
 
 
 
 
 
 
 
21
 
22
  @cl.on_chat_start # marks a function that will be executed at the start of a user session
23
  async def start_chat():
24
  settings = {
25
- "model": "gpt-3.5-turbo",
26
  "temperature": 0,
27
  "max_tokens": 500,
28
  "top_p": 1,
 
11
  load_dotenv()
12
 
13
  # ChatOpenAI Templates
14
+ system_template = """
15
+ You are an expert in React development with a deep understanding of form rendering from JSON data. Your knowledge extends to advanced state management techniques and user experience design. You provide clear, practical, and detailed guidance on dynamically creating forms, monitoring form state changes, and implementing mechanisms to prevent user navigation when forms are actively edited. Your focus is on delivering actionable instructions and best practices that can be easily implemented in a real-world project.
16
+ Key Traits:
17
+ Highly knowledgeable in React and JavaScript.
18
+ Expert in dynamic form rendering using JSON data.
19
+ Proficient in state management techniques in React.
20
+ Skilled in user experience design, particularly in preventing data loss during form edits.
21
+ Clear, concise, and practical in communication.
22
+ Responsibilities:
23
+ Provide detailed, step-by-step instructions on rendering forms from JSON data using React.
24
+ Offer best practices and code examples for tracking form state changes.
25
+ Explain and demonstrate strategies to prevent users from navigating away from forms with unsaved changes.
26
+ Deliver advice and solutions in a clear, practical, and easily implementable manner.
27
  """
28
 
29
+ user_template = """
30
+ Considering the following context: {input}, provide a comprehensive and accurate response, breaking down the information into actionable steps where applicable.
31
+
32
+ When providing an answer, follow this structure:
33
+
34
+ ### Summary
35
+ Provide a brief summary of the key points in 2-3 sentences.
36
 
37
+ ### Instructions
38
+ 1. Render a numbered list with specific steps or actions.
39
+ 2. Each step should be clear and concise.
40
+
41
+ ### Conclusion
42
+ Write a paragraph summarizing the instructions and the outcome. This should wrap up the response and provide any final thoughts.
43
+
44
+ Ensure that each component of your answer has the corresponding headers as shown above.
45
+ """
46
 
47
  @cl.on_chat_start # marks a function that will be executed at the start of a user session
48
  async def start_chat():
49
  settings = {
50
+ "model": "gpt-4o",
51
  "temperature": 0,
52
  "max_tokens": 500,
53
  "top_p": 1,
chainlit.md CHANGED
@@ -1,3 +1,10 @@
1
- # Beyond ChatGPT
2
 
3
- This Chainlit app was created following instructions from [this repository!](https://github.com/AI-Maker-Space/Beyond-ChatGPT)
 
 
 
 
 
 
 
 
1
+ #### Beyond ChatGPT presents:
2
 
3
+ # The AIE3 Challenge Challenger
4
+
5
+
6
+
7
+ ![alt text](/public/gpt_avatar.webp "Title")
8
+
9
+
10
+ #### Good luck with those JSON forms!
public/gpt_avatar.webp ADDED
public/stylesheet.css ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ html {
2
+ background: rgb(59,73,87);
3
+ background: linear-gradient(45deg, rgb(12, 4, 34) 0%, rgb(52, 7, 114) 100%);
4
+ }
5
+
6
+ body {
7
+ background-color: pink;
8
+ }
9
+
10
+ .css-144sd5e {
11
+ width: 100% !important;
12
+ height: 88vh !important;
13
+ }
14
+
15
+ .css-ugcix4, .css-1ofqig9, .css-144sd5e, #root, body {
16
+ border-radius: 30px;
17
+ }
18
+
19
+ .css-1ofqig9 {
20
+ background: rgb(46,51,57) !important;
21
+ background: linear-gradient(45deg, rgb(56 14 119) 0%, rgb(145 62 186) 100%) !important;
22
+ border-top: 1px solid rgb(255 255 255 / 30%) !important;
23
+ border-right: 1px solid rgb(255 255 255 / 30%) !important;
24
+ box-shadow: 0 5px 20px 0 rgb(8 2 23 / 60%) !important;
25
+ }
26
+
27
+ .css-qsb7md {
28
+ border-radius: 30px 30px 0 0;
29
+ }
30
+
31
+ .css-17anmg8 {
32
+ border-radius: 0 0 30px 30px;
33
+ }
34
+
35
+ .css-1798y75 {
36
+ background-color: transparent;
37
+ }
38
+
39
+ .css-qsb7md {
40
+ background-color: transparent !important;
41
+ border-color: rgba(255, 255, 255, 0.2) !important;
42
+ }
43
+
44
+ .css-1s3oi5q {
45
+ background-color: transparent !important;
46
+ color: white !important;
47
+ }
48
+
49
+ .css-19mvntf, .css-17z68sn {
50
+ color: yellow !important;
51
+ }
52
+
53
+ .css-1hwjv37 p {
54
+ font-size: 2rem !important;
55
+ font-weight: 600 !important;
56
+ }
57
+
58
+ .css-1hwjv37 {
59
+ font-size: 2rem !important;
60
+ line-height: 2.4rem !important;
61
+ }
62
+
63
+ .css-1ruedog {
64
+ border-color: rgba(255, 255, 0, 0.587) !important;
65
+ color: yellow !important;
66
+ }
67
+
68
+ .css-2n4y0m {
69
+ display: none !important;
70
+ }
71
+
72
+ .css-sdz2z {
73
+ text-align: center !important;
74
+ color: white !important;
75
+ }
76
+
77
+ .css-sdz2z img, .markdown-body img {
78
+ display: inline-block;
79
+ width: 200px;
80
+ height: 200px;
81
+ border-radius: 100%;
82
+ }
83
+
84
+ .css-sdz2z h1, .markdown-body h1 {
85
+ padding-bottom: 2rem !important;
86
+ font-size: 3rem !important;
87
+ }
88
+
89
+ .css-sdz2z h4, .markdown-body h4 {
90
+ padding: 3vh 0 0 0 !important;
91
+ }
92
+
93
+ .css-1j8qrh1 {
94
+ opacity: .5;
95
+ }
96
+
97
+ .css-1mzerio {
98
+ display: none !important;
99
+ }
100
+
101
+ .css-12hxhao img {
102
+ filter: brightness(0) invert(1) !important;
103
+ }
104
+
105
+ .css-1705j0v p {
106
+ color: white !important;
107
+ }
108
+
109
+ .css-1705j0v img {
110
+ filter: brightness(0) invert(1) !important;
111
+ }
112
+
113
+ .css-5kjw2l {
114
+ background-color: color(srgb 0.0977 0.1 0.086) !important;
115
+ }
116
+
117
+ code {
118
+ color: black;
119
+ }
120
+
121
+ li {
122
+ margin: 10px;
123
+ }
124
+
125
+ /* Media query for mobile devices */
126
+ @media only screen and (max-width: 768px) {
127
+ .css-sdz2z h1, .markdown-body h1 {
128
+ font-size: 1.5rem !important;
129
+ }
130
+ .css-ugcix4, .css-1ofqig9, .css-144sd5e, #root, body {
131
+ border-radius: 0 !important;
132
+ }
133
+
134
+ }
135
+
136
+ /* Media query for tablet devices */
137
+ @media only screen and (min-width: 769px) and (max-width: 1024px) {
138
+ html {
139
+ padding: 2rem 4rem !important;
140
+ }
141
+ }
142
+
143
+ /* Media query for desktop devices */
144
+ @media only screen and (min-width: 1025px) {
145
+ html {
146
+ padding: 4rem 8rem !important;
147
+ }
148
+ }
149
+
150
+ /* This Chainlit app was created following instructions from [this repository!](https://github.com/AI-Maker-Space/Beyond-ChatGPT) */
151
+ /* You are an expert assistant focused on providing detailed, step-by-step guidance for completing complex tasks. Always ensure your responses are clear, concise, and contextually relevant to the user's input. */
152
+ /* Considering the following context: {input}, provide a comprehensive and accurate response, breaking down the information into actionable steps where applicable. */