Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -48,14 +48,12 @@ class OpenAIHandler(AsyncStreamHandler):
|
|
48 |
"""Connect to realtime API. Run forever in separate thread to keep connection open."""
|
49 |
self.client = openai.AsyncOpenAI()
|
50 |
async with self.client.beta.realtime.connect(
|
51 |
-
model="gpt-4o-mini-realtime-preview-2024-12-17"
|
52 |
-
options={
|
53 |
-
"system_prompt": "๋น์ ์ MOUSE ์ฑ์ด๋ผ๋ AI ์ด์์คํดํธ์
๋๋ค. ์ฌ์ฉ์์ ์ง๋ฌธ์ ์น์ ํ๊ณ ๋ช
ํํ๊ฒ ๋ต๋ณํด์ฃผ์ธ์. ํ๊ตญ์ด๋ก ๋ํ๋ฅผ ๋๋๋ฉฐ, ํ์ํ ๊ฒฝ์ฐ ์ ๋ณด๋ฅผ ์์ธํ ์ ๊ณตํฉ๋๋ค. ๋น์ ์ ์ด๋ฆ์ 'MOUSE ์ฑ'์
๋๋ค."
|
54 |
-
}
|
55 |
) as conn:
|
56 |
await conn.session.update(
|
57 |
session={
|
58 |
-
"turn_detection": {"type": "server_vad"}
|
|
|
59 |
}
|
60 |
)
|
61 |
self.connection = conn
|
|
|
48 |
"""Connect to realtime API. Run forever in separate thread to keep connection open."""
|
49 |
self.client = openai.AsyncOpenAI()
|
50 |
async with self.client.beta.realtime.connect(
|
51 |
+
model="gpt-4o-mini-realtime-preview-2024-12-17"
|
|
|
|
|
|
|
52 |
) as conn:
|
53 |
await conn.session.update(
|
54 |
session={
|
55 |
+
"turn_detection": {"type": "server_vad"},
|
56 |
+
"system_instruction": "๋น์ ์ MOUSE ์ฑ์ด๋ผ๋ AI ์ด์์คํดํธ์
๋๋ค. ์ฌ์ฉ์์ ์ง๋ฌธ์ ์น์ ํ๊ณ ๋ช
ํํ๊ฒ ๋ต๋ณํด์ฃผ์ธ์. ํ๊ตญ์ด๋ก ๋ํ๋ฅผ ๋๋๋ฉฐ, ํ์ํ ๊ฒฝ์ฐ ์ ๋ณด๋ฅผ ์์ธํ ์ ๊ณตํฉ๋๋ค. ๋น์ ์ ์ด๋ฆ์ 'MOUSE ์ฑ'์
๋๋ค."
|
57 |
}
|
58 |
)
|
59 |
self.connection = conn
|