-
Notifications
You must be signed in to change notification settings - Fork 2.9k
ADDED AZURE OPEN AI SUPPORT #927
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
base: master
Are you sure you want to change the base?
ADDED AZURE OPEN AI SUPPORT #927
Conversation
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.
1 issue found across 5 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="src/lib/searxng.ts">
<violation number="1" location="src/lib/searxng.ts:46">
`new URL('/search', baseUrl)` drops any existing path segments from the configured SearXNG URL, so instances hosted under a subpath (e.g. https://host/searxng) will now be queried at the wrong endpoint.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Ask questions if you need clarification on any suggestion
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
src/lib/searxng.ts
Outdated
| ); | ||
| } | ||
|
|
||
| const url = new URL('/search', baseUrl); |
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.
new URL('/search', baseUrl) drops any existing path segments from the configured SearXNG URL, so instances hosted under a subpath (e.g. https://host/searxng) will now be queried at the wrong endpoint.
Prompt for AI agents
Address the following comment on src/lib/searxng.ts at line 46:
<comment>`new URL('/search', baseUrl)` drops any existing path segments from the configured SearXNG URL, so instances hosted under a subpath (e.g. https://host/searxng) will now be queried at the wrong endpoint.</comment>
<file context>
@@ -23,9 +22,29 @@ export const searchSearxng = async (
+ );
+ }
+
+ const url = new URL('/search', baseUrl);
+ url.searchParams.append('format', 'json');
url.searchParams.append('q', query);
</file context>
✅ Addressed in e1e0436
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.
Reviewed changes from recent commits (found 1 issue).
1 issue found across 1 file
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="src/lib/searxng.ts">
<violation number="1" location="src/lib/searxng.ts:51">
Using `new URL('search', normalizedBase)` appends `search` to whatever path the user configured. If the SearXNG URL already includes `/search`, this generates `.../search/search` and the request fails. Switching back to an absolute path keeps compatibility with those configurations.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
| normalizedBase.pathname = `${normalizedBase.pathname}/`; | ||
| } | ||
|
|
||
| const url = new URL('search', normalizedBase); |
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.
Using new URL('search', normalizedBase) appends search to whatever path the user configured. If the SearXNG URL already includes /search, this generates .../search/search and the request fails. Switching back to an absolute path keeps compatibility with those configurations.
Prompt for AI agents
Address the following comment on src/lib/searxng.ts at line 51:
<comment>Using `new URL('search', normalizedBase)` appends `search` to whatever path the user configured. If the SearXNG URL already includes `/search`, this generates `.../search/search` and the request fails. Switching back to an absolute path keeps compatibility with those configurations.</comment>
<file context>
@@ -43,7 +43,12 @@ export const searchSearxng = async (
+ normalizedBase.pathname = `${normalizedBase.pathname}/`;
+ }
+
+ const url = new URL('search', normalizedBase);
url.searchParams.append('format', 'json');
url.searchParams.append('q', query);
</file context>
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.
5 issues found across 26 files (reviewed changes from recent commits).
Prompt for AI agents (all 5 issues)
Understand the root cause of the following 5 issues and fix them.
<file name="mobile/PerplexicaMobile/Info.plist">
<violation number="1" location="mobile/PerplexicaMobile/Info.plist:22">
Setting NSAllowsArbitraryLoads to true disables App Transport Security for the entire app, exposing all network traffic to insecure HTTP. Please remove this exemption or scope it narrowly so ATS remains enforced.</violation>
</file>
<file name="src/components/MessageInputActions/SummarizeVideo.tsx">
<violation number="1" location="src/components/MessageInputActions/SummarizeVideo.tsx:40">
Icon-only trigger button needs an accessible name. Please add an aria-label or equivalent screen-reader text so assistive technology can announce the action.</violation>
</file>
<file name="src/components/MessageInputActions/AttachSmall.tsx">
<violation number="1" location="src/components/MessageInputActions/AttachSmall.tsx:91">
The broader accept attribute now allows image types (e.g. HEIC, TIFF) that the upload API rejects because IMAGE_EXTENSIONS only includes jpg/jpeg/png/gif/bmp/webp, so users hit a 400 "File type not supported". Please limit the accept list to the supported extensions (and mirror the change in the other input).</violation>
</file>
<file name="mobile/PerplexicaMobile/AppSettings.swift">
<violation number="1" location="mobile/PerplexicaMobile/AppSettings.swift:31">
UserDefaults should not be used for API secrets because it stores values unencrypted on disk; please move the API key to the Keychain or another secure storage mechanism.</violation>
</file>
<file name="src/lib/hooks/useChat.tsx">
<violation number="1" location="src/lib/hooks/useChat.tsx:551">
Reset messageAppeared to false before starting summarizeYoutubeVideo so the loading indicator displays while the summary request is pending.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| <key>CFBundleVersion</key> | ||
| <string>1</string> | ||
| <key>LSRequiresIPhoneOS</key> | ||
| <true/> |
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.
Setting NSAllowsArbitraryLoads to true disables App Transport Security for the entire app, exposing all network traffic to insecure HTTP. Please remove this exemption or scope it narrowly so ATS remains enforced.
Prompt for AI agents
Address the following comment on mobile/PerplexicaMobile/Info.plist at line 22:
<comment>Setting NSAllowsArbitraryLoads to true disables App Transport Security for the entire app, exposing all network traffic to insecure HTTP. Please remove this exemption or scope it narrowly so ATS remains enforced.</comment>
<file context>
@@ -0,0 +1,42 @@
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UIApplicationSceneManifest</key>
+ <dict>
</file context>
| <true/> | |
| <false/> |
|
|
||
| return ( | ||
| <> | ||
| <button |
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.
Icon-only trigger button needs an accessible name. Please add an aria-label or equivalent screen-reader text so assistive technology can announce the action.
Prompt for AI agents
Address the following comment on src/components/MessageInputActions/SummarizeVideo.tsx at line 40:
<comment>Icon-only trigger button needs an accessible name. Please add an aria-label or equivalent screen-reader text so assistive technology can announce the action.</comment>
<file context>
@@ -0,0 +1,118 @@
+
+ return (
+ <>
+ <button
+ type="button"
+ onClick={() => setOpen(true)}
</file context>
| onChange={handleChange} | ||
| ref={fileInputRef} | ||
| accept=".pdf,.docx,.txt" | ||
| accept=".pdf,.docx,.txt,.png,.jpg,.jpeg,.gif,.bmp,.webp,image/*" |
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.
The broader accept attribute now allows image types (e.g. HEIC, TIFF) that the upload API rejects because IMAGE_EXTENSIONS only includes jpg/jpeg/png/gif/bmp/webp, so users hit a 400 "File type not supported". Please limit the accept list to the supported extensions (and mirror the change in the other input).
Prompt for AI agents
Address the following comment on src/components/MessageInputActions/AttachSmall.tsx at line 91:
<comment>The broader accept attribute now allows image types (e.g. HEIC, TIFF) that the upload API rejects because IMAGE_EXTENSIONS only includes jpg/jpeg/png/gif/bmp/webp, so users hit a 400 "File type not supported". Please limit the accept list to the supported extensions (and mirror the change in the other input).</comment>
<file context>
@@ -88,7 +88,7 @@ const AttachSmall = () => {
onChange={handleChange}
ref={fileInputRef}
- accept=".pdf,.docx,.txt"
+ accept=".pdf,.docx,.txt,.png,.jpg,.jpeg,.gif,.bmp,.webp,image/*"
multiple
hidden
</file context>
| accept=".pdf,.docx,.txt,.png,.jpg,.jpeg,.gif,.bmp,.webp,image/*" | |
| accept=".pdf,.docx,.txt,.png,.jpg,.jpeg,.gif,.bmp,.webp" |
|
|
||
| func save() { | ||
| defaults.set(baseURLString, forKey: .baseURLKey) | ||
| defaults.set(apiKey, forKey: .apiKey) |
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.
UserDefaults should not be used for API secrets because it stores values unencrypted on disk; please move the API key to the Keychain or another secure storage mechanism.
Prompt for AI agents
Address the following comment on mobile/PerplexicaMobile/AppSettings.swift at line 31:
<comment>UserDefaults should not be used for API secrets because it stores values unencrypted on disk; please move the API key to the Keychain or another secure storage mechanism.</comment>
<file context>
@@ -0,0 +1,50 @@
+
+ func save() {
+ defaults.set(baseURLString, forKey: .baseURLKey)
+ defaults.set(apiKey, forKey: .apiKey)
+ defaults.set(selectedFocusMode.rawValue, forKey: .focusMode)
+ defaults.set(selectedOptimizationMode.rawValue, forKey: .optimizationMode)
</file context>
| ]); | ||
|
|
||
| setChatHistory((prev) => [...prev, ['human', userContent]]); | ||
| setLoading(true); |
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.
Reset messageAppeared to false before starting summarizeYoutubeVideo so the loading indicator displays while the summary request is pending.
Prompt for AI agents
Address the following comment on src/lib/hooks/useChat.tsx at line 551:
<comment>Reset messageAppeared to false before starting summarizeYoutubeVideo so the loading indicator displays while the summary request is pending.</comment>
<file context>
@@ -509,6 +511,146 @@ export const ChatProvider = ({ children }: { children: React.ReactNode }) => {
+ ]);
+
+ setChatHistory((prev) => [...prev, ['human', userContent]]);
+ setLoading(true);
+
+ try {
</file context>
Summary by cubic
Add Azure OpenAI support, a YouTube video summarizer, image uploads with captions, and a lightweight iOS client. Also harden SearXNG search and file processing.
New Features
Bug Fixes
Written for commit 38594f2. Summary will update automatically on new commits.