Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyaspimpalgaonkar committed Sep 13, 2024
1 parent d1d16a3 commit 96eed5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions py/core/providers/parsing/unstructured_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ async def parse(
metadata=metadata,
)

if iteration == 0:
raise ValueError(f"No chunks found for document {document.id}")

logger.debug(
f"Parsed document with id={document.id}, title={document.metadata.get('title', None)}, "
f"user_id={document.metadata.get('user_id', None)}, metadata={document.metadata} "
Expand Down
4 changes: 2 additions & 2 deletions py/core/providers/prompts/r2r_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import os
from pathlib import Path
from typing import Any, Optional
from uuid import uuid5, NAMESPACE_DNS

import yaml

from core.base import Prompt, PromptConfig, PromptProvider, R2RException
from core.base.utils import generate_id_from_label
from core.providers.database.postgres import PostgresDBProvider

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -218,7 +218,7 @@ async def _save_prompt_to_database(self, prompt: Prompt):
await self.execute_query(
query,
[
uuid4(),
generate_id_from_label(prompt.name),
prompt.name,
prompt.template,
json.dumps(prompt.input_types),
Expand Down

0 comments on commit 96eed5f

Please sign in to comment.