Skip to content
Snippets Groups Projects
Commit dd606432 authored by Jonas Eppelt's avatar Jonas Eppelt
Browse files

bugfix

parent 643af062
Branches
No related tags found
No related merge requests found
......@@ -66,24 +66,7 @@ class ChatETProvider(BaseProvider, ChatOllama):
model_id_key = "ChatETP"
model_id_label = "ChatETP version"
models = [
"*"
]
model_list = [
"deepseek-r1:1.5b",
"deepseek-r1:7b",
"deepseek-r1:8b",
"deepseek-r1:14b",
"deepseek-coder-v2:16b",
"llama3.3",
"mistral",
"codellama:7b",
"codellama:13b",
"r1-1776:70b",
"codellama:34b",
"codellama:70b",
]
models = ["*"]
persona = Persona(
name="ChatETP",
avatar_route="api/ai/static/jupyternaut.svg",
......@@ -95,7 +78,24 @@ class ChatETProvider(BaseProvider, ChatOllama):
# TextField(key="model", label="Model ID", format="text"),
]
help: str = (
"available models:" + ", \n ".join(models) + ""
"available models:"
+ ", \n ".join(
[
"deepseek-r1:1.5b",
"deepseek-r1:7b",
"deepseek-r1:8b",
"deepseek-r1:14b",
"deepseek-coder-v2:16b",
"llama3.3",
"mistral",
"codellama:7b",
"codellama:13b",
"r1-1776:70b",
"codellama:34b",
"codellama:70b",
]
)
+ ""
)
base_url: str = "deepthought.etp.kit.edu:11434"
# format:str = "json"
......@@ -152,18 +152,28 @@ class ChatETProvider(BaseProvider, ChatOllama):
from jupyter_ai.chat_handlers.base import BaseChatHandler, SlashCommandRoutingType
from jupyter_ai.models import HumanChatMessage
from jupyter_ai.chat_handlers.default import DefaultChatHandler
from jupyterlab_chat.models import Message, NewMessage, User
from jupyterlab_chat.ychat import YChat
class ChatETP(BaseChatHandler):
id = "ChatETP"
name = "ChatETP"
help = "A chat handler that does something custom"
routing_type = SlashCommandRoutingType(slash_id="custom")
class ChatETPHandler(DefaultChatHandler):
id = "ChatETPHandler"
name = "ChatETPHandler"
help = "ChatETP helps you do Moder method of datanalysis"
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def reply(self, body: str, _human_message=None) -> str:
"""
Adds a message to the YChat shared document that this chat handler is
assigned to. Returns the new message ID.
async def process_message(self, message: HumanChatMessage):
# Put your custom logic here
print(message)
print(self.reply("I am a custom chat handler", message))
TODO: Either properly store & use reply state in YChat, or remove the
`human_message` argument here.
"""
bot = self.ychat.get_user(BOT["username"])
if not bot:
self.ychat.set_user(User(**BOT))
t = NewMessage(body=body, sender=BOT["username"])
print(t)
id = self.ychat.add_message(t)
return id
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment