Skip to content

selected_model returns None when session is created #420

@julianchun

Description

@julianchun

I am creating a session without explicitly passing a model, expecting the SDK to utilize a default model.
However, when I attempt to retrieve the model information from the session messages, the selected_model field is None.

Is this intended behavior?
If so, what is the recommended way to determine which default model the session is currently using before send a message?

import asyncio
from copilot import CopilotClient

async def main():
    client = CopilotClient()
    await client.start()
    session = await client.create_session() # without specify model
    messages = await session.get_messages()
    start_event = next(m for m in messages if m.type.value == "session.start")  
    print(f"selected model: {start_event.data.selected_model}") # selected model: None
  
if __name__ == "__main__":
    asyncio.run(main())

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions