Skip to content

Commit da552cc

Browse files
authored
Fix the Python list_sessions docstring example to use session_id (#2099)
The Example block in CopilotClient.list_sessions printed session.sessionId, but list_sessions returns list[SessionMetadata], and that dataclass declares session_id. sessionId exists only as the wire key, mapped to session_id inside SessionMetadata.from_dict/to_dict, so anyone copying the documented example hit: AttributeError: 'SessionMetadata' object has no attribute 'sessionId' Use the attribute the returned dataclass actually declares. The Go and .NET bindings already document this method with their own idiomatic spelling of the same field. Docstring text only: no public API, behavior, or wire format change. Co-authored-by: examon <examon@users.noreply.github.com>
1 parent 4a8a8e6 commit da552cc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

python/copilot/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3386,7 +3386,7 @@ async def list_sessions(self, filter: SessionListFilter | None = None) -> list[S
33863386
Example:
33873387
>>> sessions = await client.list_sessions()
33883388
>>> for session in sessions:
3389-
... print(f"Session: {session.sessionId}")
3389+
... print(f"Session: {session.session_id}")
33903390
>>> # Filter sessions by repository
33913391
>>> from copilot.client import SessionListFilter
33923392
>>> filtered = await client.list_sessions(SessionListFilter(repository="owner/repo"))

0 commit comments

Comments
 (0)