borakol commited on
Commit
1818da7
·
verified ·
1 Parent(s): 1bfe2ff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -2,11 +2,16 @@ import gradio as gr
2
  from google import genai
3
  from smolagents import DuckDuckGoSearchTool
4
  import os
 
 
 
5
 
6
- search_tool = DuckDuckGoSearchTool()
7
  GEMINI_API_KEY = os.getenv("GEMINI_API_KEY")
8
  client = genai.Client(api_key=GEMINI_API_KEY)
9
 
 
 
 
10
  def search_and_answer(question:str) -> str: ## question string tipinde olmalı ve çıktısı da string olmalı , değişkenin doğru şekilde gönderilmesi ve çıktının istenilen formatta alınması sağlanabilir
11
  result = search_tool(question)
12
 
 
2
  from google import genai
3
  from smolagents import DuckDuckGoSearchTool
4
  import os
5
+ from dotenv import load_dotenv
6
+
7
+ load_dotenv()
8
 
 
9
  GEMINI_API_KEY = os.getenv("GEMINI_API_KEY")
10
  client = genai.Client(api_key=GEMINI_API_KEY)
11
 
12
+ search_tool = DuckDuckGoSearchTool()
13
+
14
+
15
  def search_and_answer(question:str) -> str: ## question string tipinde olmalı ve çıktısı da string olmalı , değişkenin doğru şekilde gönderilmesi ve çıktının istenilen formatta alınması sağlanabilir
16
  result = search_tool(question)
17