Skip to content

Update moss plugin api#2

Open
CoderOMaster wants to merge 5 commits intomainfrom
update-moss-plugin-api
Open

Update moss plugin api#2
CoderOMaster wants to merge 5 commits intomainfrom
update-moss-plugin-api

Conversation

@CoderOMaster
Copy link
Collaborator

Updated with latest doc updates.
Ran type checks and linting

@CoderOMaster CoderOMaster self-assigned this Feb 12, 2026
Comment on lines +4 to +24
from typing import Any, TYPE_CHECKING

try:
if TYPE_CHECKING:
from inferedge_moss import (
AddDocumentsOptions,
DocumentInfo,
GetDocumentsOptions,
IndexInfo,
MossClient as _InferEdgeMossClient,
QueryOptions,
SearchResult,
)
except ImportError:
_InferEdgeMossClient = None
else:
try:
from inferedge_moss import (
AddDocumentsOptions,
DocumentInfo,
GetDocumentsOptions,
IndexInfo,
MossClient as _InferEdgeMossClient,
QueryOptions,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it a conditional import?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used TYPECHECK to safely handle during type checking.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when i remove it and keep it clean, it fails on make type-check

DocumentInfo,
GetDocumentsOptions,
IndexInfo,
MossClient as _InferEdgeMossClient,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also do not use the string Inferedge.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay sure

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should i just use MossClient as just client?

livekit-plugins/livekit-plugins-moss/livekit/plugins/moss/MossClient.py:68: error: Name "MossClient" already defined (possibly by an import) [no-redef]
Found 1 error in 1 file (checked 478 source files)
✗ Type checking failed
make: *** [type-check] Error 1

Get the type-check error if i don't reference it and directly use mossclient

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the livekit-plugins-moss integration to align with the latest inferedge-moss SDK (version 1.0.0b12). The changes enhance the plugin's API surface by exposing new query options and index management capabilities while maintaining full backward compatibility with existing code.

Changes:

  • Bumped inferedge-moss dependency from 1.0.0b2 to 1.0.0b12
  • Added QueryOptions export for advanced query configuration
  • Enhanced index loading with auto-refresh capabilities and added unload_index method
  • Made create_index model_id parameter optional and updated query method to support QueryOptions

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
pyproject.toml Updated inferedge-moss dependency version from 1.0.0b2 to 1.0.0b12
__init__.py Added QueryOptions to module exports
MossClient.py Refactored imports with TYPE_CHECKING pattern, added QueryOptions support, enhanced load_index with auto-refresh parameters, added unload_index method, improved variable naming and documentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +208 to +210
result = await self._client.load_index( # type: ignore[call-arg]
index_name, auto_refresh, polling_interval_in_seconds
)
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type ignore comment suggests that the type stubs for inferedge-moss version 1.0.0b12 may not yet reflect these new parameters (auto_refresh and polling_interval_in_seconds). Consider verifying that these parameters match the actual API signature of the underlying library, and if the type stubs are available but incomplete, consider contributing updated stubs to the inferedge-moss project.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HarshaNalluru is there anything i need to change here?

"""Unload an index from memory."""

logger.debug("unloading moss index", extra={"index": index_name})
await self._client.unload_index(index_name) # type: ignore[attr-defined]
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type ignore comment indicates that the unload_index method may not be recognized by type checkers. Similar to the load_index method, consider verifying that the method signature matches the actual API and updating type stubs if needed.

Copilot uses AI. Check for mistakes.
raise RuntimeError(
"inferedge-moss is required to use MossClient. Install it via `pip install inferedge-moss`."
"moss is required to use MossClient. Install it via `pip install inferedge-moss`."
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message refers to "moss" but should be consistent with the actual package name "inferedge-moss" as shown in the error message on line 33 and the installation instruction. Consider changing this to "inferedge-moss is required to use MossClient" for consistency.

Suggested change
"moss is required to use MossClient. Install it via `pip install inferedge-moss`."
"inferedge-moss is required to use MossClient. Install it via `pip install inferedge-moss`."

Copilot uses AI. Check for mistakes.
@CoderOMaster CoderOMaster force-pushed the update-moss-plugin-api branch from 541cab1 to 8fe13a9 Compare February 13, 2026 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants