Skip to content

Conversation

@theomonnom
Copy link
Member

@theomonnom theomonnom commented Mar 10, 2025

I think it is a good timing to do it for v1.0

@theomonnom theomonnom requested review from a team and lukasIO March 10, 2025 15:30
Copy link
Contributor

@lukasIO lukasIO left a comment

Choose a reason for hiding this comment

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

makes sense to me, should we have a last 0.x release that deprecates it and offers alternatives?

@theomonnom
Copy link
Member Author

we will release a major version, v1.0

@theomonnom theomonnom merged commit f23e8d7 into main Mar 13, 2025
12 checks passed
@theomonnom theomonnom deleted the remove-chat-manager branch March 13, 2025 13:07
@nightincode
Copy link

Whats the alternative here guys? You pulled these api's, the docs are all outdated. Whats the alternative for this or have we reached a point where the community needs to fork?

@peter-assort
Copy link

peter-assort commented Mar 20, 2025

Whats the alternative here guys? You pulled these api's, the docs are all outdated. Whats the alternative for this or have we reached a point where the community needs to fork?

Plus one, I wanted to update Livekit deps and now I don't know how to start it

    chat_manager: rtc.ChatManager,
                  ^^^^^^^^^^^^^^^
AttributeError: module 'livekit.rtc' has no attribute 'ChatManager'. Did you mean: 'E2EEManager'?

Happened when I did

# livekit-plugins-elevenlabs = "0.7.9" -> "0.8.11"
poetry update

poetry.lock diff

+    {file = "livekit-0.22.0.tar.gz", hash = "sha256:273fd75a164fb1be6745ddd624361fba86131be397e629597719f303f2c29730"},

@NameICanWrite
Copy link

I bet it is in many peoples code right now. Deleting it without explanation and message about deprecation is a mistake

@NameICanWrite
Copy link

I am going to just write the same code myself. The only possible alternative ...

@NameICanWrite
Copy link

So , what I have done - I just copied the code from the deleted rtc/chat.py to custom_chat_manager.py . And used it like this for agent to answer text messages for example. It worked

from custom_chat_manager import ChatManager, ChatMessage

def on_chat_message(message: ChatMessage):
            asyncio.create_task(livekit_service.pipeline_answer_from_text(agent, message.message))

        chat_manager = ChatManager(ctx.room)
        chat_manager.on("message_received", on_chat_message)
        
async def pipeline_answer_from_text(
    agent: VoicePipelineAgent,
    txt: str,
    role: Literal["user", "assistant", "system", "tool"] = "user",
):
    logger.info(f"Pipeline answer from text: {txt} with role: {role}")
    chat_ctx = agent.chat_ctx.copy()
    chat_ctx.append(role=role, text=txt)
    stream = agent.llm.chat(chat_ctx=chat_ctx)
    await agent.say(stream)

@longcw
Copy link
Contributor

longcw commented Mar 22, 2025

Sorry about that. We'll be releasing Agents 1.0 soon, which will offer a number of new features, including the ability to use text streaming for text input.

@josiahbryan
Copy link

For anyone coming here like me also wondering why ChatManager was removed - CW graciously explained in slack that ChatManager was "mis-leading" and the wrong layer of abstraction, and it's better to just handle the data frames directly - appreciate the explaination!

@davidzhao
Copy link
Member

apologies for the lack of explanation. we are in the middle of upgrading the whole text stack in LiveKit to TextStreams.

the frontend apps will be updated in the next week as well. instead of ChatManager, you could listen to a text stream of lk.chat and text = await reader.read_all() once the reader is received.

if this becomes an issue for you, please feel free to use an older version of livekit package for now.

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.

9 participants