Merge branch 'main' into feature/chinese-document-splitter

This commit is contained in:
MaChi 2025-06-05 17:37:55 +08:00 committed by GitHub
commit 1fd4dfddcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 9 deletions

View File

@ -7,15 +7,11 @@ from dataclasses import MISSING, fields, is_dataclass
from inspect import getdoc
from typing import Any, Callable, Dict, List, Sequence, Tuple, Union, get_args, get_origin
from docstring_parser import parse
from pydantic import BaseModel, Field, create_model
from haystack import logging
from haystack.dataclasses import ChatMessage
from haystack.lazy_imports import LazyImport
with LazyImport(message="Run 'pip install docstring-parser'") as docstring_parser_import:
from docstring_parser import parse
logger = logging.getLogger(__name__)
@ -33,7 +29,6 @@ def _get_param_descriptions(method: Callable) -> Tuple[str, Dict[str, str]]:
if not docstring:
return "", {}
docstring_parser_import.check()
parsed_doc = parse(docstring)
param_descriptions = {}
for param in parsed_doc.params:

View File

@ -57,6 +57,7 @@ dependencies = [
"numpy",
"python-dateutil",
"jsonschema", # JsonSchemaValidator, Tool
"docstring-parser", # ComponentTool
"haystack-experimental",
]
@ -129,9 +130,6 @@ dependencies = [
# Structured logging
"structlog",
# ComponentTool
"docstring-parser",
# needed in link content fetcher tests
"httpx[http2]",

View File

@ -0,0 +1,4 @@
---
enhancements:
- |
Made doc-parser a core dependency since ComponentTool that uses it is one of the core Tool components.