Skip to content

Commit

Permalink
Add logging for reasoning content and update reasoning_content column…
Browse files Browse the repository at this point in the history
… to allow variable length in schema.
  • Loading branch information
swuecho committed Feb 4, 2025
1 parent 4452483 commit 625a894
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/chat_main_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ func (h *ChatHandler) chatStream(w http.ResponseWriter, chatSession sqlc_queries
textBuffer.appendByIndex(textIdx, delta.Content)
if len(delta.ReasoningContent) > 0 {
hasReason = true
log.Printf("%+v", delta.ReasoningContent)
reasonBuffer.appendByIndex(textIdx, delta.ReasoningContent)
}

Expand Down
2 changes: 1 addition & 1 deletion api/sqlc/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ ALTER TABLE chat_message ADD COLUMN IF NOT EXISTS token_count INTEGER DEFAULT 0
ALTER TABLE chat_message ADD COLUMN IF NOT EXISTS is_pin BOOLEAN NOT NULL DEFAULT false;
ALTER TABLE chat_message ADD COLUMN IF NOT EXISTS llm_summary character varying(1024) NOT NULL DEFAULT '';
ALTER TABLE chat_message ADD COLUMN IF NOT EXISTS model character varying(255) NOT NULL DEFAULT '';
ALTER TABLE chat_message ADD COLUMN IF NOT EXISTS reasoning_content character varying(255) NOT NULL DEFAULT '';
ALTER TABLE chat_message ADD COLUMN IF NOT EXISTS reasoning_content character varying NOT NULL DEFAULT '';

-- add hash index on uuid
CREATE INDEX IF NOT EXISTS chat_message_uuid_idx ON chat_message using hash (uuid) ;
Expand Down

0 comments on commit 625a894

Please sign in to comment.