Skip to content

Commit 5c22ca4

Browse files
committed
minor UI changes
1 parent da22d81 commit 5c22ca4

File tree

4 files changed

+29
-27
lines changed

4 files changed

+29
-27
lines changed

src/backend/search/providers/bing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async def get_link_results(
4343
]
4444

4545
async def get_image_results(
46-
self, client: httpx.AsyncClient, query: str, num_results: int = 5
46+
self, client: httpx.AsyncClient, query: str, num_results: int = 4
4747
) -> list[str]:
4848
response = await client.get(
4949
f"{self.host}/images/search",

src/backend/search/providers/searxng.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async def get_link_results(
3838
]
3939

4040
async def get_image_results(
41-
self, client: httpx.AsyncClient, query: str, num_results: int = 5
41+
self, client: httpx.AsyncClient, query: str, num_results: int = 4
4242
) -> list[str]:
4343
response = await client.get(
4444
f"{self.host}/search",

src/backend/search/providers/serper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async def get_link_results(
4343
]
4444

4545
async def get_image_results(
46-
self, client: httpx.AsyncClient, query: str, num_results: int = 5
46+
self, client: httpx.AsyncClient, query: str, num_results: int = 4
4747
) -> list[str]:
4848
response = await client.get(
4949
f"{self.host}/images",

src/frontend/src/components/assistant-message.tsx

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -56,36 +56,38 @@ export const AssistantMessageContent = ({
5656

5757
return (
5858
<div className="flex flex-col">
59-
<Section title="Sources" animate={isStreaming}>
60-
{!sources || sources.length === 0 ? (
61-
<SearchResultsSkeleton />
62-
) : (
63-
<SearchResults results={sources} />
64-
)}
65-
</Section>
6659
<Section title="Answer" animate={isStreaming} streaming={isStreaming}>
6760
{content ? (
6861
<MessageComponent message={message} isStreaming={isStreaming} />
6962
) : (
7063
<MessageComponentSkeleton />
7164
)}
72-
{images && images.length > 0 && (
73-
<div className="my-4 grid grid-cols-1 gap-2 lg:grid-cols-2">
74-
{images.map((image) => (
75-
<a
76-
key={image}
77-
href={image}
78-
target="_blank"
79-
rel="noopener noreferrer"
80-
className="aspect-video w-full h-full overflow-hidden hover:scale-[1.03] duration-150 rounded-lg transition-all shadow-md"
81-
>
82-
<img
83-
src={image}
84-
className="w-full object-cover object-top h-full max-h-[80vh]"
85-
/>
86-
</a>
87-
))}
88-
</div>
65+
</Section>
66+
<Section title="Sources" animate={isStreaming}>
67+
{!sources || sources.length === 0 ? (
68+
<SearchResultsSkeleton />
69+
) : (
70+
<>
71+
<SearchResults results={sources} />
72+
{images && images.length > 0 && (
73+
<div className="my-4 grid grid-cols-1 gap-2 lg:grid-cols-2">
74+
{images.map((image) => (
75+
<a
76+
key={image}
77+
href={image}
78+
target="_blank"
79+
rel="noopener noreferrer"
80+
className="aspect-video w-full h-full overflow-hidden hover:scale-[1.03] duration-150 rounded-lg transition-all shadow-md"
81+
>
82+
<img
83+
src={image}
84+
className="w-full object-cover object-top h-full max-h-[80vh]"
85+
/>
86+
</a>
87+
))}
88+
</div>
89+
)}
90+
</>
8991
)}
9092
</Section>
9193
{relatedQuestions && relatedQuestions.length > 0 && (

0 commit comments

Comments
 (0)