bartowski commited on
Commit
3e6eaab
1 Parent(s): 0cb6957

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +32 -31
README.md CHANGED
@@ -68,6 +68,7 @@ Dolphin is trained on a vast variety of data, including conversational, logical,
68
 
69
  ### General knowledge:
70
 
 
71
  <|im_start|>system
72
  You are Dolphin, a helpful AI assistant.
73
  <|im_end|>
@@ -79,11 +80,11 @@ The ISO number in camera terminology refers to the camera's sensitivity to light
79
  A higher ISO number means that the camera's sensor is more sensitive to light, allowing for faster shutter speeds in low-light situations. However, increasing the ISO also increases the risk of image noise (graininess) in the final image. Conversely, a lower ISO number means that the camera's sensor is less sensitive to light, requiring slower shutter speeds in well-lit conditions to avoid overexposure.
80
 
81
  In summary, the ISO number in camera terminology determines how sensitive the camera's sensor is to light, and it can be adjusted to balance exposure and image quality in various lighting conditions.
82
-
83
 
84
  ### Conversational:
85
 
86
-
87
  <|im_start|>system
88
  You are Dolphin, a helpful AI assistant.
89
  <|im_end|>
@@ -107,11 +108,11 @@ To find your purpose, you can follow these steps:
107
  6. Seek guidance and support: Share your journey with friends, family, or mentors who can offer valuable advice, encouragement, and resources to help you find your purpose.
108
 
109
  Ultimately, finding your purpose is a personal and ongoing process that requires introspection, self-awareness, and a willingness to explore new opportunities. Remember, there is no one-size-fits-all answer to the meaning of life, and your purpose may change and evolve over time.
110
-
111
 
112
  ### Coding:
113
 
114
-
115
  <|im_start|>system
116
  You are Dolphin, a helpful AI assistant.
117
  <|im_end|>
@@ -121,41 +122,41 @@ I have a multi select component in react, and I register it to a useForm. I want
121
  Yes, it is possible to validate the number of selected items in a multi select component in React with the help of `useForm`. You can use the `validate` function from `react-hook-form` to achieve this. Here's a step-by-step guide on how to do it:
122
 
123
  First, import the necessary libraries:
124
- ```jsx
125
- import { useForm } from 'react-hook-form';
126
- import { MultiSelect } from 'your-multi-select-component';
127
- ```
128
 
129
  Next, create a form with the multi select component:
130
- ```jsx
131
- function MyForm() {
132
- const { register, handleSubmit, errors } = useForm();
133
-
134
- const onSubmit = data => {
135
- // Handle form submission logic here
136
- };
137
-
138
- return (
139
- <form onSubmit={handleSubmit(onSubmit)}>
140
- <MultiSelect
141
- name="multiSelect"
142
- ref={register({ required: true, validate: value => value.length <= 10 })}
143
- />
144
- {errors.multiSelect && (
145
- <p>Please select no more than 10 items.</p>
146
- )}
147
- <input type="submit" />
148
- </form>
149
- );
150
- }
151
- ```
152
 
153
  In the above code, we register the multi select component with the `useForm` hook. The `validate` function is used to validate that the number of selected items is less than or equal to 10. If the validation fails, an error message will be displayed.
154
 
155
  Remember to replace `'your-multi-select-component'` with the name of your multi select component.
156
 
157
  That's it! Now, when the form is submitted, it will validate that no more than 10 items are selected in the multi select component.
158
-
159
 
160
  ## Technical Details
161
 
 
68
 
69
  ### General knowledge:
70
 
71
+ ```
72
  <|im_start|>system
73
  You are Dolphin, a helpful AI assistant.
74
  <|im_end|>
 
80
  A higher ISO number means that the camera's sensor is more sensitive to light, allowing for faster shutter speeds in low-light situations. However, increasing the ISO also increases the risk of image noise (graininess) in the final image. Conversely, a lower ISO number means that the camera's sensor is less sensitive to light, requiring slower shutter speeds in well-lit conditions to avoid overexposure.
81
 
82
  In summary, the ISO number in camera terminology determines how sensitive the camera's sensor is to light, and it can be adjusted to balance exposure and image quality in various lighting conditions.
83
+ ```
84
 
85
  ### Conversational:
86
 
87
+ ```
88
  <|im_start|>system
89
  You are Dolphin, a helpful AI assistant.
90
  <|im_end|>
 
108
  6. Seek guidance and support: Share your journey with friends, family, or mentors who can offer valuable advice, encouragement, and resources to help you find your purpose.
109
 
110
  Ultimately, finding your purpose is a personal and ongoing process that requires introspection, self-awareness, and a willingness to explore new opportunities. Remember, there is no one-size-fits-all answer to the meaning of life, and your purpose may change and evolve over time.
111
+ ```
112
 
113
  ### Coding:
114
 
115
+ ```
116
  <|im_start|>system
117
  You are Dolphin, a helpful AI assistant.
118
  <|im_end|>
 
122
  Yes, it is possible to validate the number of selected items in a multi select component in React with the help of `useForm`. You can use the `validate` function from `react-hook-form` to achieve this. Here's a step-by-step guide on how to do it:
123
 
124
  First, import the necessary libraries:
125
+
126
+ import { useForm } from 'react-hook-form';
127
+ import { MultiSelect } from 'your-multi-select-component';
128
+
129
 
130
  Next, create a form with the multi select component:
131
+
132
+ function MyForm() {
133
+ const { register, handleSubmit, errors } = useForm();
134
+
135
+ const onSubmit = data => {
136
+ // Handle form submission logic here
137
+ };
138
+
139
+ return (
140
+ <form onSubmit={handleSubmit(onSubmit)}>
141
+ <MultiSelect
142
+ name="multiSelect"
143
+ ref={register({ required: true, validate: value => value.length <= 10 })}
144
+ />
145
+ {errors.multiSelect && (
146
+ <p>Please select no more than 10 items.</p>
147
+ )}
148
+ <input type="submit" />
149
+ </form>
150
+ );
151
+ }
152
+
153
 
154
  In the above code, we register the multi select component with the `useForm` hook. The `validate` function is used to validate that the number of selected items is less than or equal to 10. If the validation fails, an error message will be displayed.
155
 
156
  Remember to replace `'your-multi-select-component'` with the name of your multi select component.
157
 
158
  That's it! Now, when the form is submitted, it will validate that no more than 10 items are selected in the multi select component.
159
+ ```
160
 
161
  ## Technical Details
162