Spaces:
Sleeping
Sleeping
Kushwanth Chowday Kandala
commited on
Commit
·
c68709e
1
Parent(s):
701fc06
update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
| 2 |
|
| 3 |
|
| 4 |
gemini_api_key = os.getenv("GEMINI_API_KEY")
|
|
@@ -8,14 +10,14 @@ def to_markdown(text):
|
|
| 8 |
text = text.replace('•', ' *')
|
| 9 |
return Markdown(textwrap.indent(text, '> ', predicate=lambda _: True)
|
| 10 |
|
| 11 |
-
to_markdown(response.text)
|
| 12 |
-
|
| 13 |
import google.generativeai as genai
|
| 14 |
|
| 15 |
genai.configure(api_key = gemini_api_key)
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
| 19 |
|
| 20 |
# Define a function that will be called when the user clicks the button
|
| 21 |
def greet_user():
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from IPython.display import display
|
| 3 |
+
from IPython.display import Markdown
|
| 4 |
|
| 5 |
|
| 6 |
gemini_api_key = os.getenv("GEMINI_API_KEY")
|
|
|
|
| 10 |
text = text.replace('•', ' *')
|
| 11 |
return Markdown(textwrap.indent(text, '> ', predicate=lambda _: True)
|
| 12 |
|
|
|
|
|
|
|
| 13 |
import google.generativeai as genai
|
| 14 |
|
| 15 |
genai.configure(api_key = gemini_api_key)
|
| 16 |
|
| 17 |
+
model = genai.GenerativeModel('gemini-pro')
|
| 18 |
+
response = model.generate_content("What is the meaning of life?")
|
| 19 |
+
|
| 20 |
+
to_markdown(response.text)
|
| 21 |
|
| 22 |
# Define a function that will be called when the user clicks the button
|
| 23 |
def greet_user():
|