You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/libs/core/langchain_core
ale-delfino 0df76bee37
core[patch]:: XML parser to cover the case when the xml only contains the root level tag (#17456)
Description: Fix xml parser to handle strings that only contain the root
tag
Issue: N/A
Dependencies: None
Twitter handle: N/A

A valid xml text can contain only the root level tag. Example: <body>
  Some text here
</body>
The example above is a valid xml string. If parsed with the current
implementation the result is {"body": []}. This fix checks if the root
level text contains any non-whitespace character and if that's the case
it returns {root.tag: root.text}. The result is that the above text is
correctly parsed as {"body": "Some text here"}

@ale-delfino

Thank you for contributing to LangChain!

Checklist:

- [x] PR title: Please title your PR "package: description", where
"package" is whichever of langchain, community, core, experimental, etc.
is being modified. Use "docs: ..." for purely docs changes, "templates:
..." for template changes, "infra: ..." for CI changes.
  - Example: "community: add foobar LLM"
- [x] PR message: **Delete this entire template message** and replace it
with the following bulleted list
    - **Description:** a description of the change
    - **Issue:** the issue # it fixes, if applicable
    - **Dependencies:** any dependencies required for this change
- **Twitter handle:** if your PR gets announced, and you'd like a
mention, we'll gladly shout you out!
- [x] Pass lint and test: Run `make format`, `make lint` and `make test`
from the root of the package(s) you've modified to check that you're
passing lint and testing. See contribution guidelines for more
information on how to write/run tests, lint, etc:
https://python.langchain.com/docs/contributing/
- [x] Add tests and docs: If you're adding a new integration, please
include
1. a test for the integration, preferably unit tests that do not rely on
network access,
2. an example notebook showing its use. It lives in
`docs/docs/integrations` directory.

Additional guidelines:
- Make sure optional dependencies are imported within a function.
- Please do not add dependencies to pyproject.toml files (even optional
ones) unless they are required for unit tests.
- Most PRs should not touch more than one package.
- Changes should be backwards compatible.
- If you are adding something to community, do not re-import it in
langchain.

If no one reviews your PR within a few days, please @-mention one of
@baskaryan, @efriis, @eyurtsev, @hwchase17.

---------

Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
3 months ago
..
_api core[patch]: fix beta, deprecated typing (#18877) 3 months ago
beta core: Updated docstring for Context class (#19079) 3 months ago
callbacks [Enhancement] Add support for directly providing a run_id (#18990) 3 months ago
document_loaders community: If load() has been overridden, use it in default lazy_load() (#18690) 3 months ago
documents core[minor]: move document compressor base (#17910) 4 months ago
embeddings core[minor]: moved fake llms and embeddings to core (#19226) 3 months ago
example_selectors core[minor]: Add async methods to MaxMarginalRelevanceExampleSelector (#19639) 3 months ago
language_models core: Two updates to chat model interface (#19684) 3 months ago
load load: Optionally disable reading secrets from env (#19596) 3 months ago
messages core[patch]: Update `messages` namespace to fix API reference docs (#19161) 3 months ago
output_parsers core[patch]:: XML parser to cover the case when the xml only contains the root level tag (#17456) 3 months ago
outputs docs: modules descriptions (#17844) 4 months ago
prompts docs: Update docstring for MessagesPlaceholder (#19601) 3 months ago
pydantic_v1 Separate out langchain_core package (#13577) 7 months ago
runnables core[runnables]: docstring for class RunnableSerializable, method configurable_fields (#19722) 3 months ago
tracers core[major]: On Tool End Observation Casting Fix (#18798) 3 months ago
utils core[patch]: fix beta, deprecated typing (#18877) 3 months ago
__init__.py core[patch], community[patch]: mark runnable context, lc load as beta (#15603) 5 months ago
agents.py docs: modules descriptions (#17844) 4 months ago
caches.py docs: modules descriptions (#17844) 4 months ago
chat_history.py docs: modules descriptions (#17844) 4 months ago
chat_sessions.py docs: modules descriptions (#17844) 4 months ago
env.py core[patch]: update langchain-core runtime library name (#14884) 6 months ago
exceptions.py docs: modules descriptions (#17844) 4 months ago
globals.py core[patch]: Move `globals` to a module instead of a package (non breaking change) (#19159) 3 months ago
memory.py docs: modules descriptions (#17844) 4 months ago
prompt_values.py docs: modules descriptions (#17844) 4 months ago
py.typed core[minor], langchain[patch], experimental[patch]: Added missing `py.typed` to `langchain_core` (#14143) 7 months ago
retrievers.py [Enhancement] Add support for directly providing a run_id (#18990) 3 months ago
stores.py core: upgrade mypy to recent mypy (#18753) 3 months ago
sys_info.py docs: modules descriptions (#17844) 4 months ago
tools.py core[patch]: ToolException docs/exception message (#17590) 3 months ago
vectorstores.py core[minor]: Add async methods to MaxMarginalRelevanceExampleSelector (#19639) 3 months ago