Skip to content

Conversation

@pblazej
Copy link
Contributor

@pblazej pblazej commented Aug 25, 2025

  • Extracts many parts of AppViewModel into Session
  • Simplifies internal dependencies, etc. so that the app is mostly a wrapper around (extracted) Session - ready to be consumed by UI

Needs SDK+components bump

@pblazej
Copy link
Contributor Author

pblazej commented Sep 3, 2025

As for known issues: the visualizer for avatars probably won't work in the "minimal" case, due to wrong order of fallbacks, will fix this soon - let's focus on the public APIs.

@pblazej pblazej requested review from bcherry and lukasIO September 3, 2025 11:58
Copy link

@1egoman 1egoman left a comment

Choose a reason for hiding this comment

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

Left some notes - I think some of the discussion on the web / react pull request also applies here too, and we just need to come to some consistent decisions both implementations can adopt.

@pblazej
Copy link
Contributor Author

pblazej commented Sep 4, 2025

@1egoman thank you for digging into that (again) 😄 IMO the areas of improvement are still the same (not that many of them). Let it serve as our bullet points for the meeting.

@pblazej
Copy link
Contributor Author

pblazej commented Sep 10, 2025

@lukasIO @1egoman recent improvements and notable mentions:

  • moved Message creation, split userInput from userTranscript
  • removed Features in favor of app-level FeatureSwitches
  • exposed _room
  • added CredentialsProvider, let's try to finalize that in the web pr first 🤞
  • moved all media/track related stuff to what's called DeviceSwitcher for now (better name LocalMedia ?)
  • added agentName "handling" - that should be enough to "wait for this particular agent"

@pblazej
Copy link
Contributor Author

pblazej commented Sep 11, 2025

@lukasIO re: separate "media/devices hook" - I updated the minimal example above 🫴

  MinimalExample()
                .environmentObject(DeviceSwitcher(room: room))
                .environmentObject(AgentSession(credentials: Sandbox(id: "your-id"), room: room))

The key is both must point to the same Room (created externally, no way to make it implicit). Also, you gotta think about initialization (cannot instantiate prop with another prop basically).

The only solution it to make them coupled, so that the Room is passed implicitly like that d8a2e04. I think it's fairly easy to understand and harder to break.

@pblazej pblazej force-pushed the blaze/agent-abstraction branch from d8a2e04 to 25ce2cf Compare September 18, 2025 12:18
@pblazej pblazej changed the title [Draft] Agent abstraction [WIP] Agent API integration Sep 18, 2025
Copy link
Contributor

@bcherry bcherry left a comment

Choose a reason for hiding this comment

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

this is a really nice simplification

private static let sandboxId = Bundle.main.object(forInfoDictionaryKey: "LiveKitSandboxId") as! String
@StateObject private var conversation = Conversation(credentials: CachingCredentialsProvider(SandboxTokenServer(id: Self.sandboxId)),
// agentName: ...
room: Room(roomOptions: RoomOptions(defaultScreenShareCaptureOptions: ScreenShareCaptureOptions(useBroadcastExtension: true))))
Copy link
Contributor

Choose a reason for hiding this comment

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

you should include some notes about alternatives and also update the readme instructions to match the changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, let's try to merge the pyramid of PRs first, I need to bump sdk+components anyway here 👍

@pblazej pblazej changed the title [WIP] Agent API integration [WIP] Session API integration Oct 16, 2025
@pblazej pblazej force-pushed the blaze/agent-abstraction branch from 904bbb0 to b329d36 Compare October 23, 2025 10:01
@pblazej pblazej force-pushed the blaze/agent-abstraction branch from 1c08e99 to ea30032 Compare October 27, 2025 09:17
@pblazej pblazej changed the title [WIP] Session API integration Session API integration Oct 27, 2025
@pblazej pblazej marked this pull request as ready for review October 27, 2025 09:26
@pblazej pblazej requested a review from hiroshihorie October 27, 2025 09:26
pblazej added a commit to livekit/client-sdk-swift that referenced this pull request Oct 27, 2025
Adds 3 basic building blocks for simple(r) agent experiences:
- `Session` - connection, pre-connect, agent dispatch, agent filtering
(e.g. by name), all agents, messages (broadcasted and aggregated for
now)
- `Agent` - wrapper around `Participant`, knows its tracks and internal
state
- `LocalMedia` - (unrelated) helper to deal with local tracks in SwiftUI

Example: livekit-examples/agent-starter-swift#29
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.

4 participants