Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
from anthropic import Anthropic, HUMAN_PROMPT, AI_PROMPT
|
| 2 |
from langchain.chat_models import init_chat_model
|
| 3 |
from langchain_anthropic import ChatAnthropic
|
| 4 |
-
from langchain_openai import ChatOpenAI
|
| 5 |
from langchain.prompts import ChatPromptTemplate, MessagesPlaceholder
|
| 6 |
from langchain.schema import StrOutputParser
|
| 7 |
from langchain.schema.runnable import Runnable
|
|
@@ -1133,9 +1132,8 @@ async def on_chat_start():
|
|
| 1133 |
contextChat = cl.user_session.get("contextChatBot")
|
| 1134 |
if not contextChat:
|
| 1135 |
contextChat = "Il n'y a pas de contexte."
|
| 1136 |
-
|
| 1137 |
if settings['APCC'] == "Aucune":
|
| 1138 |
-
model = ChatOpenAI(model_name="mistralai/Mistral-Small-3.1-24B-Instruct-2503", base_url='https://albert.api.etalab.gouv.fr/v1', openai_api_key="univ-eiffel-db5d86ccaa211c177093a0b699cb29b6a8f0a75349734212de9b452d6f9c1e38b42808acea077fc5eec31ff1d7080cc6be279d623dcce4bf8a8123a8ce9a0a2e")
|
| 1139 |
prompt = ChatPromptTemplate.from_messages(
|
| 1140 |
[
|
| 1141 |
(
|
|
|
|
| 1 |
from anthropic import Anthropic, HUMAN_PROMPT, AI_PROMPT
|
| 2 |
from langchain.chat_models import init_chat_model
|
| 3 |
from langchain_anthropic import ChatAnthropic
|
|
|
|
| 4 |
from langchain.prompts import ChatPromptTemplate, MessagesPlaceholder
|
| 5 |
from langchain.schema import StrOutputParser
|
| 6 |
from langchain.schema.runnable import Runnable
|
|
|
|
| 1132 |
contextChat = cl.user_session.get("contextChatBot")
|
| 1133 |
if not contextChat:
|
| 1134 |
contextChat = "Il n'y a pas de contexte."
|
| 1135 |
+
|
| 1136 |
if settings['APCC'] == "Aucune":
|
|
|
|
| 1137 |
prompt = ChatPromptTemplate.from_messages(
|
| 1138 |
[
|
| 1139 |
(
|