-
Notifications
You must be signed in to change notification settings - Fork 1
Demo #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kfallah
wants to merge
12
commits into
main
Choose a base branch
from
demo
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Demo #10
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0c10cde
Add Memories for Demo
kfallah 9254868
Add Prompt
kfallah c77629c
Fix Error
kfallah f2ee2b2
Fix
kfallah 97fec66
Fix2
kfallah 2d716f3
Merge branch 'main' into kion/main-llm-2
kfallah 9f31c15
Demo
kfallah 89c92f7
Pro
kfallah 1f238ec
Add Interrupts
kfallah d9ca4fd
Fix docker-compose
matiszz fde885d
Update ChatWindow component for better text handling and increase ret…
matiszz 942294d
Merge pull request #11 from kfallah/fix/demo
matiszz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| # Google Gemini API Key | ||
| # Get your API key from: https://makersuite.google.com/app/apikey | ||
| GEMINI_API_KEY=your_gemini_api_key_here | ||
|
|
||
| # Enable demo image conditioning (loads images from ./demo as context) | ||
| DEMO_ENABLED=false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Find funding of a YC 2025 winter startup at https://www.ycombinator.com/companies?batch=Winter%202025. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Find funding of a YC 2025 winter startup at https://www.ycombinator.com/companies?batch=Winter%202025. | ||
|
|
||
| Pick 3 startups from the YC 2025 batch, check how much they raised by doing a google search in a separate tab, and add their names and most recent raise to the google docs at https://docs.google.com/document/d/1IzFp0tiDhllwW_mdyCQKkvNY7uKFYNulge1A4gAvCYs/edit?tab=t.0 on a new line. | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| .vercel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,9 +5,11 @@ import RecordingMetadataModal from './RecordingMetadataModal' | |
|
|
||
| interface Message { | ||
| id: string | ||
| role: 'user' | 'assistant' | 'system' | ||
| role: 'user' | 'assistant' | 'system' | 'memory' | ||
| content: string | ||
| timestamp: Date | ||
| thumbnail?: string | ||
| imageCount?: number | ||
| } | ||
|
|
||
| interface ChatWindowProps { | ||
|
|
@@ -67,9 +69,36 @@ export default function ChatWindow({ isRecording = false }: ChatWindowProps) { | |
| }, | ||
| ]) | ||
| setIsLoading(false) | ||
| } else if (data.type === 'memory_injected') { | ||
| // Memory was injected - show it immediately | ||
| if (data.metadata) { | ||
| setMessages((prev) => [ | ||
| ...prev, | ||
| { | ||
| id: Date.now().toString() + '-memory', | ||
| role: 'memory', | ||
| content: `Memory retrieved: ${data.metadata.description}`, | ||
| timestamp: new Date(), | ||
| thumbnail: data.metadata.thumbnail, | ||
| imageCount: data.metadata.image_count, | ||
| }, | ||
| ]) | ||
| } | ||
| } else if (data.type === 'status') { | ||
| // Handle status updates (e.g., "thinking", "executing action") | ||
| // Handle status updates (e.g., "thinking", "executing action", "interrupt_received") | ||
| console.log('Status:', data.content) | ||
| if (data.content === 'interrupt_received') { | ||
| // Show a system message that the interrupt was received | ||
| setMessages((prev) => [ | ||
| ...prev, | ||
| { | ||
| id: Date.now().toString() + '-interrupt', | ||
| role: 'system', | ||
| content: 'Interrupt received - will be applied at next iteration', | ||
| timestamp: new Date(), | ||
| }, | ||
| ]) | ||
| } | ||
| } else if (data.type === 'recording_status') { | ||
| // Handle recording status updates | ||
| if (data.session_id) { | ||
|
|
@@ -158,7 +187,7 @@ export default function ChatWindow({ isRecording = false }: ChatWindowProps) { | |
| }, [isRecording, isConnected]) | ||
|
|
||
| const sendMessage = () => { | ||
| if (!input.trim() || !isConnected || isLoading) return | ||
| if (!input.trim() || !isConnected) return | ||
|
|
||
| const userMessage: Message = { | ||
| id: Date.now().toString(), | ||
|
|
@@ -168,14 +197,24 @@ export default function ChatWindow({ isRecording = false }: ChatWindowProps) { | |
| } | ||
|
|
||
| setMessages((prev) => [...prev, userMessage]) | ||
| setIsLoading(true) | ||
|
|
||
| wsRef.current?.send( | ||
| JSON.stringify({ | ||
| type: 'message', | ||
| content: input.trim(), | ||
| }) | ||
| ) | ||
| // If already loading, send as interrupt; otherwise send as new message | ||
| if (isLoading) { | ||
| wsRef.current?.send( | ||
| JSON.stringify({ | ||
| type: 'interrupt', | ||
| content: input.trim(), | ||
| }) | ||
| ) | ||
| } else { | ||
| setIsLoading(true) | ||
| wsRef.current?.send( | ||
| JSON.stringify({ | ||
| type: 'message', | ||
| content: input.trim(), | ||
| }) | ||
| ) | ||
| } | ||
|
|
||
| setInput('') | ||
| } | ||
|
|
@@ -279,10 +318,26 @@ export default function ChatWindow({ isRecording = false }: ChatWindowProps) { | |
| ? 'bg-blue-600 text-white' | ||
| : message.role === 'system' | ||
| ? 'bg-gray-800 text-gray-300 text-sm italic' | ||
| : message.role === 'memory' | ||
| ? 'bg-purple-900 text-purple-100 border border-purple-700' | ||
| : 'bg-gray-700 text-white' | ||
| }`} | ||
| > | ||
| <p className="whitespace-pre-wrap">{message.content}</p> | ||
| {message.role === 'memory' && message.thumbnail && ( | ||
| <div className="mb-2"> | ||
| <img | ||
| src={message.thumbnail} | ||
| alt="Memory thumbnail" | ||
| className="w-32 h-auto rounded border border-purple-600" | ||
| /> | ||
| {message.imageCount && ( | ||
| <span className="text-xs text-purple-300 mt-1 block"> | ||
| +{message.imageCount - 1} more images | ||
| </span> | ||
| )} | ||
| </div> | ||
| )} | ||
| <p className="whitespace-pre-wrap break-words">{message.content}</p> | ||
| <span className="text-xs opacity-50 mt-1 block"> | ||
| {message.timestamp.toLocaleTimeString()} | ||
| </span> | ||
|
|
@@ -314,16 +369,20 @@ export default function ChatWindow({ isRecording = false }: ChatWindowProps) { | |
| <div className="flex gap-2"> | ||
| <textarea | ||
| value={input} | ||
| onChange={(e) => setInput(e.target.value)} | ||
| onChange={(e) => { | ||
| setInput(e.target.value) | ||
| e.target.style.height = 'auto' | ||
| e.target.style.height = Math.min(e.target.scrollHeight, 120) + 'px' | ||
| }} | ||
|
Comment on lines
+372
to
+376
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Textarea auto-resize doesn’t reset after send. When 🧩 Suggested fix@@
- const messagesEndRef = useRef<HTMLDivElement>(null)
+ const messagesEndRef = useRef<HTMLDivElement>(null)
+ const inputRef = useRef<HTMLTextAreaElement>(null)
@@
- setInput('')
+ setInput('')
+ if (inputRef.current) inputRef.current.style.height = 'auto'
@@
- <textarea
+ <textarea
+ ref={inputRef}
value={input}
onChange={(e) => {
setInput(e.target.value)
e.target.style.height = 'auto'
e.target.style.height = Math.min(e.target.scrollHeight, 120) + 'px'
}}🤖 Prompt for AI Agents |
||
| onKeyDown={handleKeyDown} | ||
| placeholder="Ask the agent to do something..." | ||
| className="flex-1 bg-gray-800 text-white rounded-lg px-4 py-2 resize-none focus:outline-none focus:ring-2 focus:ring-blue-500" | ||
| className="flex-1 bg-gray-800 text-white rounded-lg px-4 py-2 resize-none focus:outline-none focus:ring-2 focus:ring-blue-500 overflow-x-hidden break-words" | ||
| rows={1} | ||
| disabled={!isConnected} | ||
| /> | ||
| <button | ||
| onClick={sendMessage} | ||
| disabled={!isConnected || !input.trim() || isLoading} | ||
| disabled={!isConnected || !input.trim()} | ||
| className="bg-blue-600 hover:bg-blue-700 disabled:bg-gray-700 disabled:cursor-not-allowed text-white px-4 py-2 rounded-lg transition-colors" | ||
| > | ||
| Send | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix capitalization of proper nouns.
"google search" should be "Google search" and "google docs" should be "Google Docs" as these are proper product names.
📝 Suggested fix
📝 Committable suggestion
🧰 Tools
🪛 LanguageTool
[uncategorized] ~3-~3: “Google” is a proper noun and needs to be capitalized.
Context: ..., check how much they raised by doing a google search in a separate tab, and add their...
(A_GOOGLE)
[uncategorized] ~3-~3: Did you mean “Google Docs”?
Context: ...heir names and most recent raise to the google docs at https://docs.google.com/document/d/1...
(GOOGLE_PRODUCTS)
🤖 Prompt for AI Agents