minchyeom commited on
Commit
ccb1848
·
1 Parent(s): 8e60b3d

Update chat prompt and fix message type in ChatSession

Browse files
Files changed (2) hide show
  1. run.py +1 -1
  2. src/chat.py +2 -2
run.py CHANGED
@@ -7,7 +7,7 @@ from src.chat import ChatSession
7
 
8
  async def _main() -> None:
9
  async with ChatSession(user="demo_user") as chat:
10
- answer = await chat.chat("What is 10 + 23?")
11
  print("\n>>>", answer)
12
 
13
 
 
7
 
8
  async def _main() -> None:
9
  async with ChatSession(user="demo_user") as chat:
10
+ answer = await chat.chat("What did you just say?")
11
  print("\n>>>", answer)
12
 
13
 
src/chat.py CHANGED
@@ -3,7 +3,7 @@ from __future__ import annotations
3
  from typing import List
4
  import json
5
 
6
- from ollama import AsyncClient, ChatResponse
7
 
8
  from .config import MAX_TOOL_CALL_DEPTH, MODEL_NAME, OLLAMA_HOST
9
  from .db import Conversation, Message, User, _db, init_db
@@ -30,7 +30,7 @@ class ChatSession:
30
 
31
  @staticmethod
32
  def _store_assistant_message(
33
- conversation: Conversation, message: ChatResponse.Message
34
  ) -> None:
35
  """Persist assistant messages, storing tool calls when present."""
36
 
 
3
  from typing import List
4
  import json
5
 
6
+ from ollama import AsyncClient, ChatResponse, Message
7
 
8
  from .config import MAX_TOOL_CALL_DEPTH, MODEL_NAME, OLLAMA_HOST
9
  from .db import Conversation, Message, User, _db, init_db
 
30
 
31
  @staticmethod
32
  def _store_assistant_message(
33
+ conversation: Conversation, message: Message
34
  ) -> None:
35
  """Persist assistant messages, storing tool calls when present."""
36