docs(python): fix KAgentSession import path in kagent-openai README#2163
Merged
EItanya merged 2 commits intoJul 7, 2026
Merged
Conversation
The Session Management example imports KAgentSession from kagent.openai.agent._session_service, but there is no `agent` subpackage under kagent/openai/. The module lives directly at kagent/openai/_session_service.py, so copy-pasting the snippet raises ModuleNotFoundError: No module named 'kagent.openai.agent'. Point the import at kagent.openai._session_service, which is where KAgentSession is defined and how the package's own code imports it. Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the kagent-openai README’s Session Management example so it imports KAgentSession from the actual module location (kagent.openai._session_service) rather than a non-existent kagent.openai.agent subpackage, preventing a runtime ModuleNotFoundError for users following the docs.
Changes:
- Update the README example import path for
KAgentSessiontokagent.openai._session_service.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
supreme-gg-gg
approved these changes
Jul 7, 2026
supreme-gg-gg
left a comment
Contributor
There was a problem hiding this comment.
thanks for the catch!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is no
agentsubpackage underkagent/openai/. The directorysrc/kagent/openai/contains the flat modules_a2a.py,_agent_executor.py,_event_converter.py,_session_service.py, and atools/package. Runningthe snippet as written raises:
Fix
Point the import at
kagent.openai._session_service, whereKAgentSessionisactually defined (
_session_service.py) and how the package's own code importsit (
_agent_executor.pyusesfrom ._session_service import KAgentSession):Verification
With the
kagent-openaipackage installed:Docs-only change; no source behavior is affected.