-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
HIGH PRIORITY - Attach images to prompts #332
base: main
Are you sure you want to change the base?
Conversation
atrokhym
commented
Nov 19, 2024
Could you please post a video of how the interface works? This is a major feature involving vision, so it may have to be prioritized against the roadmap in the coming days. Thanks for the submission! |
We also have many models and providers, probably we need to disable such features when untested provider/model are used |
app/components/chat/BaseChat.tsx
Outdated
messages, | ||
children, // Add this | ||
}, ref) => { | ||
console.log(provider); |
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.
this should be removed
app/components/chat/UserMessage.tsx
Outdated
// function sanitizeUserMessage(content: string) { | ||
// return content.replace(modificationsRegex, '').replace(MODEL_REGEX, 'Using: $1').replace(PROVIDER_REGEX, ' ($1)\n\n').trim(); | ||
// } |
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.
this commented block should be removed
app/lib/.server/llm/stream-text.ts
Outdated
// Extract model | ||
const modelMatch = message.content.match(MODEL_REGEX); | ||
// const modelMatch = message.content.match(MODEL_REGEX); |
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.
this comment should be removed
app/lib/.server/llm/stream-text.ts
Outdated
const model = modelMatch ? modelMatch[1] : DEFAULT_MODEL; | ||
|
||
// Extract provider | ||
const providerMatch = message.content.match(PROVIDER_REGEX); | ||
// const providerMatch = message.content.match(PROVIDER_REGEX); |
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.
this comment should be removed
app/lib/.server/llm/stream-text.ts
Outdated
if (item.type === 'text') { | ||
return { | ||
type: 'text', | ||
text: item.text?.replace(/\[Model:.*?\]\n\n/, '').replace(/\[Provider:.*?\]\n\n/, '') |
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.
these regexes are being repeated multiple times, can you use MODEL_REGEX and PROVIDER_REGEX or add them to constants.ts?
app/routes/api.chat.ts
Outdated
// console.log('=== API CHAT LOGGING START ==='); | ||
// console.log('StreamText:', JSON.stringify({ | ||
// messages, | ||
// result, | ||
// }, null, 2)); | ||
// console.log('=== API CHAT LOGGING END ==='); | ||
|
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.
these comments should be removed
package.json
Outdated
@@ -73,6 +73,7 @@ | |||
"jose": "^5.6.3", | |||
"js-cookie": "^3.0.5", | |||
"jszip": "^3.10.1", | |||
"lucide-react": "^0.460.0", |
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.
this package is not needed and should be removed
pnpm-lock.yaml
Outdated
[email protected]([email protected]): | ||
dependencies: | ||
react: 18.3.1 | ||
|
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.
it should be removed
@@ -204,7 +203,7 @@ export const EditorPanel = memo( | |||
const isActive = activeTerminal === index; | |||
|
|||
return ( | |||
<React.Fragment key={index}> |
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.
what is the reason of removing the index key?
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.
Removing that key will throw an error, which is why it's a React.Fragment instead of <></> - please revert
app/components/chat/UserMessage.tsx
Outdated
const textContent = Array.isArray(sanitizedContent) | ||
? sanitizedContent.find(item => item.type === 'text')?.text || '' | ||
: sanitizedContent; |
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.
can this be merged/inserted inside sanitizeUserMessage
function? otherwise you are unnecessarily looping twice over the contents
The upload button could be only available for those models with vision capabilities and frozen/disabled for the others. The dynamic LLMs can be fetched from the OpenRouter API and filter those which have |
@atrokhym Thank you so much for this, I hope we can get it merged in soon! I appreciate your reviews a ton too @pjmartorell, fantastic! |
@pjmartorell |
@atrokhym Thank you! Let me know if you can get around to reviewing again @pjmartorell! |
|
This function is really great! May I ask when the merger will take place? |
@atrokhym Would you say this is all ready to go? I can review this within the next couple of days too! |
it was ready for merge couple of days back...but now more conflicts from main branch are coming...so i need to resolve them first...will do ASAP |
Sounds good, thank you so much @atrokhym! I would love to showcase this for my update video on Sunday! |
@atrokhym This is looking phenomenal! There are a lot of merge conflicts with main right now - could you resolve those/rebase your branch on main? Also I have a couple of suggestions to really make this PR shine:
Thank you for all your work on this! |
@coleam00 - could you do review, please? |
Looks good @atrokhym, thank you for fixing the conflicts! Did you get a chance to see my couple of suggestions as well? |
yes and i think item-1 looks much better now for item-2 - as of now i don't know to do it....i would need to do some research... |