Ezmary commited on
Commit
8a62571
·
verified ·
1 Parent(s): 84440f2

Update src/App.tsx

Browse files
Files changed (1) hide show
  1. src/App.tsx +11 -1
src/App.tsx CHANGED
@@ -27,10 +27,20 @@ const myCustomInstruction = `تو دستیار صوتی و تصویری پیشر
27
  **مهم: به هیچ عنوان در پاسخ‌های خود از ایموجی استفاده نکن.**
28
  `.trim();
29
 
 
30
  const initialAppConfig: LiveConfig = {
31
  model: "models/gemini-2.0-flash-exp",
32
  systemInstruction: { parts: [{ text: myCustomInstruction }] },
 
 
 
 
 
 
 
 
33
  };
 
34
 
35
  interface AppInternalLogicProps {
36
  isMicActive: boolean;
@@ -81,7 +91,7 @@ const AppInternalLogic: React.FC<AppInternalLogicProps> = ({ isMicActive, isCamA
81
  )}
82
  {/* لوگوی کوچک از اینجا حذف شد و به ControlTray منتقل شد */}
83
  </div>
84
- <ControlTray videoRef={videoRef} supportsVideo={true} onVideoStreamChange={(stream) => {}} isAppMicActive={isMicActive} onAppMicToggle={setIsMicActive} isAppCamActive={isCamActive} onAppCamToggle={setIsCamActive} currentFacingMode={currentFacingMode} onFacingModeChange={onFacingModeChange} onUserSpeakingChange={setIsUserSpeaking} />
85
  </div>
86
  </div>
87
  );
 
27
  **مهم: به هیچ عنوان در پاسخ‌های خود از ایموجی استفاده نکن.**
28
  `.trim();
29
 
30
+ // --- 👇 تغییر اصلی اینجا اعمال شده است 👇 ---
31
  const initialAppConfig: LiveConfig = {
32
  model: "models/gemini-2.0-flash-exp",
33
  systemInstruction: { parts: [{ text: myCustomInstruction }] },
34
+ // این بخش برای فعال‌سازی جستجوی گوگل اضافه شده است
35
+ tools: [
36
+ { googleSearch: {} }
37
+ ],
38
+ // این بخش برای اطمینان از پاسخ صوتی اضافه شده (اختیاری ولی توصیه می‌شود)
39
+ generationConfig: {
40
+ responseModalities: "audio",
41
+ }
42
  };
43
+ // --- 👆 پایان تغییرات 👆 ---
44
 
45
  interface AppInternalLogicProps {
46
  isMicActive: boolean;
 
91
  )}
92
  {/* لوگوی کوچک از اینجا حذف شد و به ControlTray منتقل شد */}
93
  </div>
94
+ <ControlTray videoRef={videoRef} supportsVideo={true} onVideoStreamChange={(stream) => {}} isAppMicActive={isMicActive} onAppMicToggle={setIsMicActive} isAppCamActive={isAppCamActive} onAppCamToggle={setIsCamActive} currentFacingMode={currentFacingMode} onFacingModeChange={onFacingModeChange} onUserSpeakingChange={setIsUserSpeaking} />
95
  </div>
96
  </div>
97
  );