This commit is contained in:
Timothy Jaeryang Baek
2026-06-29 11:59:29 -05:00
parent ff5cec43bd
commit 6f8221df58
2 changed files with 55 additions and 40 deletions

View File

@@ -326,8 +326,9 @@ class SafeFireCrawlLoader(BaseLoader, RateLimitMixin, URLProcessingMixin):
self.params = params or {}
def lazy_load(self) -> Iterator[Document]:
try:
for url in self.web_paths:
for url in self.web_paths:
try:
self._sync_wait_for_rate_limit()
doc = scrape_firecrawl_url(
self.api_url,
self.api_key,
@@ -338,22 +339,32 @@ class SafeFireCrawlLoader(BaseLoader, RateLimitMixin, URLProcessingMixin):
)
if doc is not None:
yield doc
except Exception as e:
if self.continue_on_failure:
log.warning(f'Error extracting content from URLs with Firecrawl: {e}')
else:
raise e
except Exception as e:
if self.continue_on_failure:
log.warning(f'Error extracting content from {url} with Firecrawl: {e}')
continue
raise
async def alazy_load(self):
try:
docs = await run_in_threadpool(lambda: list(self.lazy_load()))
for doc in docs:
yield doc
except Exception as e:
if self.continue_on_failure:
log.warning(f'Error extracting content from URLs with Firecrawl: {e}')
else:
raise e
for url in self.web_paths:
try:
await self._wait_for_rate_limit()
doc = await run_in_threadpool(
scrape_firecrawl_url,
self.api_url,
self.api_key,
url,
verify_ssl=self.verify_ssl,
timeout=self.timeout,
params=self.params,
)
if doc is not None:
yield doc
except Exception as e:
if self.continue_on_failure:
log.warning(f'Error extracting content from {url} with Firecrawl: {e}')
continue
raise
class SafeTavilyLoader(BaseLoader, RateLimitMixin, URLProcessingMixin):

View File

@@ -1684,7 +1684,7 @@
</div>
<div class=" flex justify-between mt-0.5 mb-2.5 mx-0.5 max-w-full" dir="ltr">
<div class="ml-1 self-end flex items-center flex-1 max-w-[80%]">
<div class="ml-1 self-end flex items-center flex-1 min-w-0">
<InputMenu
bind:files
selectedModels={selectedModelIds}
@@ -1740,7 +1740,7 @@
<button
type="button"
id="input-menu-button"
class="bg-transparent hover:bg-gray-100 text-gray-700 dark:text-white dark:hover:bg-gray-800 rounded-full size-8 flex justify-center items-center outline-hidden focus:outline-hidden"
class="bg-transparent hover:bg-gray-100 text-gray-700 dark:text-white dark:hover:bg-gray-800 rounded-full size-8 flex justify-center items-center outline-hidden focus:outline-hidden shrink-0"
aria-label={$i18n.t('More')}
>
<PlusAlt className="size-5.5" />
@@ -1749,9 +1749,12 @@
{#if showWebSearchButton || showImageGenerationButton || showCodeInterpreterButton || showToolsButton || showSkillsButton || (toggleFilters && toggleFilters.length > 0)}
<div
class="flex self-center w-[1px] h-4 mx-1 bg-gray-200/50 dark:bg-gray-800/50"
class="flex self-center w-[1px] h-4 mx-1 bg-gray-200/50 dark:bg-gray-800/50 shrink-0"
/>
{/if}
<div class="flex flex-1 items-center min-w-0 overflow-x-auto scrollbar-none">
{#if showWebSearchButton || showImageGenerationButton || showCodeInterpreterButton || showToolsButton || showSkillsButton || (toggleFilters && toggleFilters.length > 0)}
<IntegrationsMenu
selectedModels={selectedModelIds}
{toggleFilters}
@@ -1783,34 +1786,34 @@
<button
type="button"
id="integration-menu-button"
class="bg-transparent hover:bg-gray-100 text-gray-700 dark:text-white dark:hover:bg-gray-800 rounded-full size-8 flex justify-center items-center outline-hidden focus:outline-hidden"
class="bg-transparent hover:bg-gray-100 text-gray-700 dark:text-white dark:hover:bg-gray-800 rounded-full size-8 flex justify-center items-center outline-hidden focus:outline-hidden shrink-0"
aria-label={$i18n.t('Integrations')}
>
<Component className="size-4.5" strokeWidth="1.5" />
</button>
</IntegrationsMenu>
{/if}
{/if}
{#if selectedModelIds.length === 1 && $models.find((m) => m.id === selectedModelIds[0])?.has_user_valves}
<div class="ml-1 flex gap-1.5">
<Tooltip content={$i18n.t('Valves')} placement="top">
<button
type="button"
id="model-valves-button"
class="bg-transparent hover:bg-gray-100 text-gray-700 dark:text-white dark:hover:bg-gray-800 rounded-full size-8 flex justify-center items-center outline-hidden focus:outline-hidden"
on:click={() => {
selectedValvesType = 'function';
selectedValvesItemId = selectedModelIds[0]?.split('.')[0];
showValvesModal = true;
}}
>
<Knobs className="size-4" strokeWidth="1.5" />
</button>
</Tooltip>
</div>
{/if}
{#if selectedModelIds.length === 1 && $models.find((m) => m.id === selectedModelIds[0])?.has_user_valves}
<div class="ml-1 flex gap-1.5 shrink-0">
<Tooltip content={$i18n.t('Valves')} placement="top">
<button
type="button"
id="model-valves-button"
class="bg-transparent hover:bg-gray-100 text-gray-700 dark:text-white dark:hover:bg-gray-800 rounded-full size-8 flex justify-center items-center outline-hidden focus:outline-hidden"
on:click={() => {
selectedValvesType = 'function';
selectedValvesItemId = selectedModelIds[0]?.split('.')[0];
showValvesModal = true;
}}
>
<Knobs className="size-4" strokeWidth="1.5" />
</button>
</Tooltip>
</div>
{/if}
<div class="ml-1 flex gap-1.5">
<div class="ml-1 flex gap-1.5 shrink-0">
{#if (selectedToolIds ?? []).length > 0}
<Tooltip
content={$i18n.t('{{COUNT}} Available Tools', {
@@ -2000,6 +2003,7 @@
</Tooltip>
{/each}
</div>
</div>
</div>
<div class="self-end flex space-x-1 mr-1 shrink-0 gap-[0.5px]">