-
Notifications
You must be signed in to change notification settings - Fork 421
Include plugins in the staged API tree for documentation builds #909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include plugins in the staged API tree for documentation builds #909
Conversation
Signed-off-by: David Gardner <[email protected]>
WalkthroughIntroduces a new API tree builder in Sphinx conf.py using pathlib and filesystem operations. Updates Data Flywheel Elasticsearch schema to use ESRequest, adapts converter and tests accordingly. Adjusts a constructor signature in OTLP span redaction exporter. Numerous docstring-only edits across multiple plugins. Adds a boilerplate init.py in utils. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Importer as Sphinx conf.py import
participant Conf as conf.py
participant FS as Filesystem
Importer->>Conf: Import module
activate Conf
Conf->>Conf: _build_api_tree()
activate Conf
Conf->>FS: Remove existing _api_tree (if exists)
FS-->>Conf: Removed/Not found
Conf->>FS: Create dirs: _api_tree/nat, _api_tree/plugins, build, etc.
Conf->>FS: Ensure __init__.py in nat/ and plugins/
Conf->>FS: Copy NVIDIA NAT hook plugin dirs to plugins/
Conf->>FS: Copy plugin subpackages into destination\n(Create empty __init__.py if missing)
Conf-->>Importer: API_TREE Path
deactivate Conf
Conf->>Conf: Set autoapi_dirs = [str(API_TREE.absolute())]
Conf->>Importer: Print "API tree built at {API_TREE}"
deactivate Conf
sequenceDiagram
autonumber
participant Conv as openai_converter.convert_langchain_openai
participant Models as dfw_es_record.ESRequest
participant Record as DFWESRecord
Conv->>Models: ESRequest(**payload)
Models-->>Conv: ESRequest instance
Conv->>Record: DFWESRecord(request=ESRequest, ...)
Record-->>Conv: DFWESRecord instance
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: David Gardner <[email protected]>
Signed-off-by: David Gardner <[email protected]>
Signed-off-by: David Gardner <[email protected]>
Signed-off-by: David Gardner <[email protected]>
This reverts commit a20826b. Signed-off-by: David Gardner <[email protected]>
Signed-off-by: David Gardner <[email protected]>
Signed-off-by: David Gardner <[email protected]>
…e had a function of the same name and because the function was imported into the package, this made the rest of the module difficult to access Signed-off-by: David Gardner <[email protected]>
Signed-off-by: David Gardner <[email protected]>
Signed-off-by: David Gardner <[email protected]>
Signed-off-by: David Gardner <[email protected]>
Signed-off-by: David Gardner <[email protected]>
…dels.api_server.Request class Signed-off-by: David Gardner <[email protected]>
Signed-off-by: David Gardner <[email protected]>
…to david-plugins-api-tree Signed-off-by: David Gardner <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/nvidia_nat_mem0ai/src/nat/plugins/mem0ai/mem0_editor.py (1)
105-115: Add missing return type hint and docstring.This public method lacks a return type hint and docstring, which violates the coding guidelines requiring type hints for all public API parameters and return values, as well as Google-style docstrings for all public functions.
Apply this diff to add the missing annotations and documentation:
- async def remove_items(self, **kwargs): + async def remove_items(self, **kwargs) -> None: + """ + Remove memory items based on provided identifiers. + + Args: + kwargs: Keyword arguments specifying items to remove. + memory_id (str, optional): Remove a specific memory by ID. + user_id (str, optional): Remove all memories for a user. + + Returns: + None + """
🧹 Nitpick comments (3)
packages/nvidia_nat_mem0ai/src/nat/plugins/mem0ai/mem0_editor.py (1)
44-48: Consider enhancing the docstring with Args and Returns sections.While the current docstring is concise, the coding guidelines specify Google-style docstrings for all public functions. Adding
Args:andReturns:sections would improve clarity and consistency across the codebase.Example enhancement:
async def add_items(self, items: list[MemoryItem]) -> None: """ Insert Multiple MemoryItems into the memory. Each MemoryItem is translated and uploaded. + + Args: + items (list[MemoryItem]): The memory items to add. + + Returns: + None """docs/source/conf.py (2)
82-83: Consider logging instead of print for build output.The
print()statement on line 83 works but is not consistent with typical Sphinx extension practices, which often use Sphinx's logging mechanism or warnings for build-time messages.Consider replacing the print statement with a logging call for better integration with Sphinx's output handling:
-print(f"API tree built at {API_TREE}") +import logging +logger = logging.getLogger(__name__) +logger.info(f"API tree built at {API_TREE}")Or keep the print but add more context:
-print(f"API tree built at {API_TREE}") +print(f"[sphinx-autoapi] API tree built at {API_TREE}")
41-79: Validate directories and optionally add error handling in_build_api_tree
- Check that
nat_dirandplugins_direxist before attempting to copy- (Optional) Wrap
rmtree,makedirs, andcopytreecalls in try/except to emit clearer errors and clean up partially-built trees on failure
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (19)
docs/source/conf.py(2 hunks)packages/nvidia_nat_adk/src/nat/plugins/adk/adk_callback_handler.py(1 hunks)packages/nvidia_nat_agno/src/nat/plugins/agno/tool_wrapper.py(1 hunks)packages/nvidia_nat_crewai/src/nat/plugins/crewai/crewai_callback_handler.py(1 hunks)packages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/exporter/dfw_elasticsearch_exporter.py(1 hunks)packages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/__init__.py(1 hunks)packages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/adapter/elasticsearch/openai_converter.py(3 hunks)packages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/schema/sink/elasticsearch/dfw_es_record.py(3 hunks)packages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/utils/__init__.py(1 hunks)packages/nvidia_nat_data_flywheel/tests/observability/processor/trace_conversion/test_span_to_dfw_record.py(15 hunks)packages/nvidia_nat_mcp/src/nat/plugins/mcp/client_impl.py(3 hunks)packages/nvidia_nat_mem0ai/src/nat/plugins/mem0ai/mem0_editor.py(1 hunks)packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/mixin/otlp_span_exporter_mixin.py(1 hunks)packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_adapter_exporter.py(2 hunks)packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_redaction_adapter_exporter.py(2 hunks)packages/nvidia_nat_phoenix/src/nat/plugins/phoenix/mixin/phoenix_mixin.py(1 hunks)packages/nvidia_nat_ragaai/src/nat/plugins/ragaai/mixin/ragaai_catalyst_mixin.py(2 hunks)packages/nvidia_nat_ragaai/src/nat/plugins/ragaai/ragaai_catalyst_exporter.py(1 hunks)packages/nvidia_nat_zep_cloud/src/nat/plugins/zep_cloud/zep_editor.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (8)
**/*.{py,yaml,yml}
📄 CodeRabbit inference engine (.cursor/rules/nat-test-llm.mdc)
**/*.{py,yaml,yml}: Configure response_seq as a list of strings; values cycle per call, and [] yields an empty string.
Configure delay_ms to inject per-call artificial latency in milliseconds for nat_test_llm.
Files:
packages/nvidia_nat_crewai/src/nat/plugins/crewai/crewai_callback_handler.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/utils/__init__.pypackages/nvidia_nat_zep_cloud/src/nat/plugins/zep_cloud/zep_editor.pypackages/nvidia_nat_agno/src/nat/plugins/agno/tool_wrapper.pypackages/nvidia_nat_ragaai/src/nat/plugins/ragaai/mixin/ragaai_catalyst_mixin.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/exporter/dfw_elasticsearch_exporter.pypackages/nvidia_nat_mcp/src/nat/plugins/mcp/client_impl.pypackages/nvidia_nat_mem0ai/src/nat/plugins/mem0ai/mem0_editor.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/schema/sink/elasticsearch/dfw_es_record.pydocs/source/conf.pypackages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_adapter_exporter.pypackages/nvidia_nat_ragaai/src/nat/plugins/ragaai/ragaai_catalyst_exporter.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/__init__.pypackages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_redaction_adapter_exporter.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/adapter/elasticsearch/openai_converter.pypackages/nvidia_nat_data_flywheel/tests/observability/processor/trace_conversion/test_span_to_dfw_record.pypackages/nvidia_nat_phoenix/src/nat/plugins/phoenix/mixin/phoenix_mixin.pypackages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/mixin/otlp_span_exporter_mixin.pypackages/nvidia_nat_adk/src/nat/plugins/adk/adk_callback_handler.py
**/*.py
📄 CodeRabbit inference engine (.cursor/rules/nat-test-llm.mdc)
**/*.py: Programmatic use: create TestLLMConfig(response_seq=[...], delay_ms=...), add with builder.add_llm("", cfg).
When retrieving the test LLM wrapper, use builder.get_llm(name, wrapper_type=LLMFrameworkEnum.) and call the framework’s method (e.g., ainvoke, achat, call).
**/*.py: In code comments/identifiers use NAT abbreviations as specified: nat for API namespace/CLI, nvidia-nat for package name, NAT for env var prefixes; do not use these abbreviations in documentation
Follow PEP 20 and PEP 8; run yapf with column_limit=120; use 4-space indentation; end files with a single trailing newline
Run ruff check --fix as linter (not formatter) using pyproject.toml config; fix warnings unless explicitly ignored
Respect naming: snake_case for functions/variables, PascalCase for classes, UPPER_CASE for constants
Treat pyright warnings as errors during development
Exception handling: use bare raise to re-raise; log with logger.error() when re-raising to avoid duplicate stack traces; use logger.exception() when catching without re-raising
Provide Google-style docstrings for every public module, class, function, and CLI command; first line concise and ending with a period; surround code entities with backticks
Validate and sanitize all user input, especially in web or CLI interfaces
Prefer httpx with SSL verification enabled by default and follow OWASP Top-10 recommendations
Use async/await for I/O-bound work; profile CPU-heavy paths with cProfile or mprof before optimizing; cache expensive computations with functools.lru_cache or external cache; leverage NumPy vectorized operations when beneficial
Files:
packages/nvidia_nat_crewai/src/nat/plugins/crewai/crewai_callback_handler.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/utils/__init__.pypackages/nvidia_nat_zep_cloud/src/nat/plugins/zep_cloud/zep_editor.pypackages/nvidia_nat_agno/src/nat/plugins/agno/tool_wrapper.pypackages/nvidia_nat_ragaai/src/nat/plugins/ragaai/mixin/ragaai_catalyst_mixin.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/exporter/dfw_elasticsearch_exporter.pypackages/nvidia_nat_mcp/src/nat/plugins/mcp/client_impl.pypackages/nvidia_nat_mem0ai/src/nat/plugins/mem0ai/mem0_editor.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/schema/sink/elasticsearch/dfw_es_record.pydocs/source/conf.pypackages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_adapter_exporter.pypackages/nvidia_nat_ragaai/src/nat/plugins/ragaai/ragaai_catalyst_exporter.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/__init__.pypackages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_redaction_adapter_exporter.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/adapter/elasticsearch/openai_converter.pypackages/nvidia_nat_data_flywheel/tests/observability/processor/trace_conversion/test_span_to_dfw_record.pypackages/nvidia_nat_phoenix/src/nat/plugins/phoenix/mixin/phoenix_mixin.pypackages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/mixin/otlp_span_exporter_mixin.pypackages/nvidia_nat_adk/src/nat/plugins/adk/adk_callback_handler.py
packages/*/src/**/*.py
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Importable Python code inside packages must live under packages//src/
Files:
packages/nvidia_nat_crewai/src/nat/plugins/crewai/crewai_callback_handler.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/utils/__init__.pypackages/nvidia_nat_zep_cloud/src/nat/plugins/zep_cloud/zep_editor.pypackages/nvidia_nat_agno/src/nat/plugins/agno/tool_wrapper.pypackages/nvidia_nat_ragaai/src/nat/plugins/ragaai/mixin/ragaai_catalyst_mixin.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/exporter/dfw_elasticsearch_exporter.pypackages/nvidia_nat_mcp/src/nat/plugins/mcp/client_impl.pypackages/nvidia_nat_mem0ai/src/nat/plugins/mem0ai/mem0_editor.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/schema/sink/elasticsearch/dfw_es_record.pypackages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_adapter_exporter.pypackages/nvidia_nat_ragaai/src/nat/plugins/ragaai/ragaai_catalyst_exporter.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/__init__.pypackages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_redaction_adapter_exporter.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/adapter/elasticsearch/openai_converter.pypackages/nvidia_nat_phoenix/src/nat/plugins/phoenix/mixin/phoenix_mixin.pypackages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/mixin/otlp_span_exporter_mixin.pypackages/nvidia_nat_adk/src/nat/plugins/adk/adk_callback_handler.py
{src/**/*.py,packages/*/src/**/*.py}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
All public APIs must have Python 3.11+ type hints on parameters and return values; prefer typing/collections.abc abstractions; use typing.Annotated when useful
Files:
packages/nvidia_nat_crewai/src/nat/plugins/crewai/crewai_callback_handler.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/utils/__init__.pypackages/nvidia_nat_zep_cloud/src/nat/plugins/zep_cloud/zep_editor.pypackages/nvidia_nat_agno/src/nat/plugins/agno/tool_wrapper.pypackages/nvidia_nat_ragaai/src/nat/plugins/ragaai/mixin/ragaai_catalyst_mixin.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/exporter/dfw_elasticsearch_exporter.pypackages/nvidia_nat_mcp/src/nat/plugins/mcp/client_impl.pypackages/nvidia_nat_mem0ai/src/nat/plugins/mem0ai/mem0_editor.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/schema/sink/elasticsearch/dfw_es_record.pypackages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_adapter_exporter.pypackages/nvidia_nat_ragaai/src/nat/plugins/ragaai/ragaai_catalyst_exporter.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/__init__.pypackages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_redaction_adapter_exporter.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/adapter/elasticsearch/openai_converter.pypackages/nvidia_nat_phoenix/src/nat/plugins/phoenix/mixin/phoenix_mixin.pypackages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/mixin/otlp_span_exporter_mixin.pypackages/nvidia_nat_adk/src/nat/plugins/adk/adk_callback_handler.py
**/*
⚙️ CodeRabbit configuration file
**/*: # Code Review Instructions
- Ensure the code follows best practices and coding standards. - For Python code, follow
PEP 20 and
PEP 8 for style guidelines.- Check for security vulnerabilities and potential issues. - Python methods should use type hints for all parameters and return values.
Example:def my_function(param1: int, param2: str) -> bool: pass- For Python exception handling, ensure proper stack trace preservation:
- When re-raising exceptions: use bare
raisestatements to maintain the original stack trace,
and uselogger.error()(notlogger.exception()) to avoid duplicate stack trace output.- When catching and logging exceptions without re-raising: always use
logger.exception()
to capture the full stack trace information.Documentation Review Instructions - Verify that documentation and comments are clear and comprehensive. - Verify that the documentation doesn't contain any TODOs, FIXMEs or placeholder text like "lorem ipsum". - Verify that the documentation doesn't contain any offensive or outdated terms. - Verify that documentation and comments are free of spelling mistakes, ensure the documentation doesn't contain any
words listed in the
ci/vale/styles/config/vocabularies/nat/reject.txtfile, words that might appear to be
spelling mistakes but are listed in theci/vale/styles/config/vocabularies/nat/accept.txtfile are OK.Misc. - All code (except .mdc files that contain Cursor rules) should be licensed under the Apache License 2.0,
and should contain an Apache License 2.0 header comment at the top of each file.
- Confirm that copyright years are up-to date whenever a file is changed.
Files:
packages/nvidia_nat_crewai/src/nat/plugins/crewai/crewai_callback_handler.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/utils/__init__.pypackages/nvidia_nat_zep_cloud/src/nat/plugins/zep_cloud/zep_editor.pypackages/nvidia_nat_agno/src/nat/plugins/agno/tool_wrapper.pypackages/nvidia_nat_ragaai/src/nat/plugins/ragaai/mixin/ragaai_catalyst_mixin.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/exporter/dfw_elasticsearch_exporter.pypackages/nvidia_nat_mcp/src/nat/plugins/mcp/client_impl.pypackages/nvidia_nat_mem0ai/src/nat/plugins/mem0ai/mem0_editor.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/schema/sink/elasticsearch/dfw_es_record.pydocs/source/conf.pypackages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_adapter_exporter.pypackages/nvidia_nat_ragaai/src/nat/plugins/ragaai/ragaai_catalyst_exporter.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/__init__.pypackages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_redaction_adapter_exporter.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/adapter/elasticsearch/openai_converter.pypackages/nvidia_nat_data_flywheel/tests/observability/processor/trace_conversion/test_span_to_dfw_record.pypackages/nvidia_nat_phoenix/src/nat/plugins/phoenix/mixin/phoenix_mixin.pypackages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/mixin/otlp_span_exporter_mixin.pypackages/nvidia_nat_adk/src/nat/plugins/adk/adk_callback_handler.py
packages/**/*
⚙️ CodeRabbit configuration file
packages/**/*: - This directory contains optional plugin packages for the toolkit, each should contain apyproject.tomlfile. - Thepyproject.tomlfile should declare a dependency onnvidia-nator another package with a name starting
withnvidia-nat-. This dependency should be declared using~=<version>, and the version should be a two
digit version (ex:~=1.0).
- Not all packages contain Python code, if they do they should also contain their own set of tests, in a
tests/directory at the same level as thepyproject.tomlfile.
Files:
packages/nvidia_nat_crewai/src/nat/plugins/crewai/crewai_callback_handler.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/utils/__init__.pypackages/nvidia_nat_zep_cloud/src/nat/plugins/zep_cloud/zep_editor.pypackages/nvidia_nat_agno/src/nat/plugins/agno/tool_wrapper.pypackages/nvidia_nat_ragaai/src/nat/plugins/ragaai/mixin/ragaai_catalyst_mixin.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/exporter/dfw_elasticsearch_exporter.pypackages/nvidia_nat_mcp/src/nat/plugins/mcp/client_impl.pypackages/nvidia_nat_mem0ai/src/nat/plugins/mem0ai/mem0_editor.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/schema/sink/elasticsearch/dfw_es_record.pypackages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_adapter_exporter.pypackages/nvidia_nat_ragaai/src/nat/plugins/ragaai/ragaai_catalyst_exporter.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/__init__.pypackages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_redaction_adapter_exporter.pypackages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/adapter/elasticsearch/openai_converter.pypackages/nvidia_nat_data_flywheel/tests/observability/processor/trace_conversion/test_span_to_dfw_record.pypackages/nvidia_nat_phoenix/src/nat/plugins/phoenix/mixin/phoenix_mixin.pypackages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/mixin/otlp_span_exporter_mixin.pypackages/nvidia_nat_adk/src/nat/plugins/adk/adk_callback_handler.py
docs/source/**/*
⚙️ CodeRabbit configuration file
This directory contains the source code for the documentation. All documentation should be written in Markdown format. Any image files should be placed in the
docs/source/_staticdirectory.
Files:
docs/source/conf.py
packages/*/tests/**/*.py
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
If a package contains Python code, include tests in a tests/ directory at the same level as pyproject.toml
Files:
packages/nvidia_nat_data_flywheel/tests/observability/processor/trace_conversion/test_span_to_dfw_record.py
🧠 Learnings (1)
📚 Learning: 2025-09-15T21:26:29.430Z
Learnt from: saglave
PR: NVIDIA/NeMo-Agent-Toolkit#726
File: examples/frameworks/adk_demo/src/nat_adk_demo/weather_update_tool.py:0-0
Timestamp: 2025-09-15T21:26:29.430Z
Learning: In NAT's ADK integration, the docstring of registered functions serves as the tool description sent to the LLM, not standard Python function documentation. The docstring should describe the logical tool interface (parameters the LLM will provide) rather than the NAT framework wrapper parameters like tool_config and builder.
Applied to files:
packages/nvidia_nat_agno/src/nat/plugins/agno/tool_wrapper.py
🧬 Code graph analysis (4)
packages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/schema/sink/elasticsearch/dfw_es_record.py (1)
packages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/schema/sink/elasticsearch/contract_version.py (1)
ContractVersion(23-31)
packages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/__init__.py (1)
packages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/span_to_dfw.py (1)
span_to_dfw_record(99-119)
packages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/adapter/elasticsearch/openai_converter.py (1)
packages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/schema/sink/elasticsearch/dfw_es_record.py (1)
ESRequest(139-151)
packages/nvidia_nat_data_flywheel/tests/observability/processor/trace_conversion/test_span_to_dfw_record.py (4)
packages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/span_to_dfw.py (2)
get_trace_container(45-96)span_to_dfw_record(99-119)packages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/trace_adapter_registry.py (1)
list_registered_types(242-248)packages/nvidia_nat_data_flywheel/tests/observability/schema/test_trace_container.py (1)
MockTraceSource(28-31)packages/nvidia_nat_data_flywheel/tests/observability/processor/test_dfw_record_processor.py (1)
MockDFWRecord(29-35)
🔇 Additional comments (30)
packages/nvidia_nat_ragaai/src/nat/plugins/ragaai/mixin/ragaai_catalyst_mixin.py (2)
188-188: LGTM! Correct reStructuredText formatting for Sphinx.The change from "Example:" to "Example::" is the proper reStructuredText syntax for introducing code blocks in Sphinx documentation, resolving the parsing issue mentioned in the PR description.
215-217: LGTM! Improved docstring readability.The line wrapping of the long parameter descriptions improves readability while maintaining the same semantic content. This aligns with PEP 8 line length recommendations.
packages/nvidia_nat_mem0ai/src/nat/plugins/mem0ai/mem0_editor.py (2)
79-79: LGTM!The docstring change correctly prevents Sphinx from interpreting
**kwargsas bold markers while preserving the semantic meaning.
86-86: No direct calls to.search(found in codebase. The review concern remains valid:searchrequiresuser_idviakwargs.pop, but neither the signature nor docstring specifies it. Add explicit validation with a clear error or update the docstring to state thatuser_idis required.packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/mixin/otlp_span_exporter_mixin.py (1)
38-39: LGTM!The docstring formatting change to use
Example::aligns with reStructuredText conventions for Sphinx documentation.packages/nvidia_nat_phoenix/src/nat/plugins/phoenix/mixin/phoenix_mixin.py (1)
38-39: LGTM!The docstring formatting change to use
Example::aligns with reStructuredText conventions for Sphinx documentation.packages/nvidia_nat_zep_cloud/src/nat/plugins/zep_cloud/zep_editor.py (1)
67-67: LGTM!The docstring parameter name change from
**kwargstokwargsprevents Sphinx from interpreting the double asterisks as bold markdown, which is consistent with the PR's objective to fix docstring parsing errors.packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_adapter_exporter.py (2)
46-47: LGTM!The docstring formatting change to use
Example::aligns with reStructuredText conventions for Sphinx documentation.
83-83: LGTM!The docstring parameter name change from
**otlp_kwargstootlp_kwargsprevents Sphinx from interpreting the double asterisks as bold markdown, which is consistent with the PR's objective to fix docstring parsing errors.packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_redaction_adapter_exporter.py (3)
58-59: LGTM!The docstring formatting change to use
Example::aligns with reStructuredText conventions for Sphinx documentation.
120-120: LGTM!The docstring parameter name change from
**otlp_kwargstootlp_kwargsprevents Sphinx from interpreting the double asterisks as bold markdown, which is consistent with the PR's objective to fix docstring parsing errors.
99-99: Incorrect signature-change concern: the constructor still uses**otlp_kwargs, so no breaking change was introduced.Likely an incorrect or invalid review comment.
docs/source/conf.py (3)
30-30: LGTM!The import of
globis necessary for finding plugin directories and is used appropriately on line 66.
35-35: LGTM!The import of
Pathfrompathlibmodernizes path handling and is used consistently throughout the new_build_api_tree()function.
118-118: LGTM!Converting the
Pathobject to a string is necessary forautoapi_dirs, which expects string paths. Using.absolute()ensures a fully qualified path.packages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/exporter/dfw_elasticsearch_exporter.py (1)
46-50: LGTM! Sphinx docstring formatting fixed.The docstring change correctly addresses the Sphinx parsing issue by removing the
**prefix fromelasticsearch_kwargsand adjusting the bullet format. This prevents Sphinx from interpreting the parameter name as bold markers.packages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/adapter/elasticsearch/openai_converter.py (3)
27-27: LGTM! Import updated to use ESRequest.The import correctly references the renamed
ESRequestclass, which resolves the naming conflict mentioned in the PR description between the data flywheel'sRequestandnat.data_models.api_server.Request.
80-80: LGTM! Sphinx docstring formatting fixed.The docstring parameter name change from
**kwargstokwargsprevents Sphinx from misinterpreting the asterisks as bold markers, consistent with the PR's Sphinx parsing error fixes.
317-321: LGTM! Request construction updated to ESRequest.The construction correctly uses
ESRequestwith all the same parameters as before. This completes the rename to resolve the naming conflict withnat.data_models.api_server.Request.packages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/processor/trace_conversion/__init__.py (1)
19-19: LGTM! Module rename resolves import conflict.The import source change from
.span_to_dfw_recordto.span_to_dfwcorrectly addresses the import conflict where a function and module shared the same name. The public API remains unchanged, maintaining backward compatibility.packages/nvidia_nat_data_flywheel/src/nat/plugins/data_flywheel/observability/schema/sink/elasticsearch/dfw_es_record.py (3)
30-31: LGTM! Import refactored to use relative path.The change to a relative import for
ContractVersionis appropriate for internal module references and improves code organization.
139-152: LGTM! Class renamed to ESRequest to resolve naming conflict.The rename from
RequesttoESRequestaddresses the conflict withnat.data_models.api_server.Requestmentioned in the PR description. All field definitions remain unchanged, making this a straightforward rename with no behavioral changes.
203-203: LGTM! Field type updated to ESRequest.The field type update from
RequesttoESRequestcorrectly reflects the class rename and maintains consistency throughout the codebase.packages/nvidia_nat_data_flywheel/tests/observability/processor/trace_conversion/test_span_to_dfw_record.py (7)
26-27: LGTM! Test imports updated for module rename.The import statements correctly reference the renamed module
span_to_dfwwhile maintaining the same function names, ensuring test continuity after the module rename.
208-208: LGTM! Mock patch path updated.The mock patch path correctly references the renamed module
span_to_dfw, ensuring the test continues to mock the logger from the correct module.
218-226: LGTM! Mock patch paths updated for registry and container.Both mock patch paths correctly reference the renamed module
span_to_dfw, ensuring mocks are applied to the correct module locations after the rename.
239-258: LGTM! Additional mock patch paths updated.The mock patches for
TraceAdapterRegistryandTraceContainerare consistently updated to reference the renamed modulespan_to_dfw.
310-311: LGTM! All test method mock patches updated.All mock patch paths in test methods are consistently updated to reference the renamed module
span_to_dfw, ensuring comprehensive test coverage after the module rename.Also applies to: 332-334, 348-350, 360-362, 373-373, 382-384, 402-404
451-451: LGTM! Integration test mock patches updated.The integration test mock patches for
TraceAdapterRegistrycorrectly reference the renamed modulespan_to_dfw.Also applies to: 467-467
555-560: LGTM! Reimport test paths updated.The import statements within the test function correctly reference the renamed module
span_to_dfw, ensuring the signature compatibility test validates imports from the correct module location.
|
/merge |
Description
span_to_dfw_recordmodule tospan_to_dfwthis fixes an issue where thespan_to_dfw_recordcontained a function of the same name, which was also imported into the package, making the rest of the module difficult to import.Requestclass toESRequestas this was conflicting with thenat.data_models.api_server.Requestclass**kwargsin a parameter list is interpreted as a bold open, without a closing**.__init__.pyfilesBy Submitting this PR I confirm:
Summary by CodeRabbit