Update main.py
Browse files
main.py
CHANGED
@@ -4,6 +4,14 @@ from Linlada import Chatbot, ConversationStyle
|
|
4 |
|
5 |
app = FastAPI()
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
async def generate(prompt):
|
8 |
bot = await Chatbot.create()
|
9 |
result = await bot.ask(prompt=prompt, conversation_style=ConversationStyle.precise)
|
|
|
4 |
|
5 |
app = FastAPI()
|
6 |
|
7 |
+
app.add_middleware(
|
8 |
+
CORSMiddleware,
|
9 |
+
allow_origins=["*"],
|
10 |
+
allow_methods=["*"],
|
11 |
+
allow_headers=["*"],
|
12 |
+
allow_credentials=True,
|
13 |
+
)
|
14 |
+
|
15 |
async def generate(prompt):
|
16 |
bot = await Chatbot.create()
|
17 |
result = await bot.ask(prompt=prompt, conversation_style=ConversationStyle.precise)
|