Update main.py
Browse files
main.py
CHANGED
@@ -90,6 +90,13 @@ async def chat_profile():
|
|
90 |
|
91 |
@cl.set_starters
|
92 |
async def set_starters():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
return [
|
94 |
cl.Starter(
|
95 |
label="L'IA comme outil pour les enseignants et les étudiants",
|
@@ -126,17 +133,7 @@ async def set_starters():
|
|
126 |
|
127 |
@cl.on_message
|
128 |
async def on_message(message: cl.Message):
|
129 |
-
|
130 |
-
print(message.content)
|
131 |
-
print(message.type)
|
132 |
-
if message.type == "system_message":
|
133 |
-
# do something with the message
|
134 |
-
await cl.Message(f"Lien : ").send()
|
135 |
-
return
|
136 |
-
|
137 |
-
fn = cl.CopilotFunction(name="test", args={"msg": message.content})
|
138 |
-
res = await fn.acall()
|
139 |
-
await cl.Message(content=res).send()
|
140 |
|
141 |
model = await LLMistral()
|
142 |
retriever = await Retriever("videosTC")
|
|
|
90 |
|
91 |
@cl.set_starters
|
92 |
async def set_starters():
|
93 |
+
if cl.context.session.client_type == "copilot":
|
94 |
+
await cl.Message(f"Lien : {message.content}").send()
|
95 |
+
await cl.Message(f"Type : {message.type}").send()
|
96 |
+
if message.type == "system_message":
|
97 |
+
# do something with the message
|
98 |
+
await cl.Message(f"Lien : ").send()
|
99 |
+
return
|
100 |
return [
|
101 |
cl.Starter(
|
102 |
label="L'IA comme outil pour les enseignants et les étudiants",
|
|
|
133 |
|
134 |
@cl.on_message
|
135 |
async def on_message(message: cl.Message):
|
136 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
|
138 |
model = await LLMistral()
|
139 |
retriever = await Retriever("videosTC")
|