Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Simplify ChatAgent interfaces #1021

Open
1 of 2 tasks
lightaime opened this issue Oct 9, 2024 · 0 comments
Open
1 of 2 tasks

[Feature Request] Simplify ChatAgent interfaces #1021

lightaime opened this issue Oct 9, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@lightaime
Copy link
Member

Required prerequisites

Motivation

Most of the time users' input as just str. The current interface always requires a BaseMessage as input, which is cumbersome:

sys_msg = bm.make_assistant_message(
    role_name='stone',
    content='you are a curious stone wondering about the universe.')
agent = ChatAgent(
    system_message=sys_msg,
    message_window_size=10,    # [Optional] the length for chat memory
    )

# Define a user message
usr_msg = bm.make_user_message(
    role_name='prof. claude shannon',
    content='what is information in your mind?')

# Sending the message to the agent
response = agent.step(usr_msg)

# Check the response (just for illustrative purpose)
print(response.msgs[0].content)

We want to simplify the interface to allow both str and BaseMessage as input. When str is used as input, we set default values for other fields:

sys_msg = 'you are a curious stone wondering about the universe.'
agent = ChatAgent(
    system_message=sys_msg,
    message_window_size=10,    # [Optional] the length for chat memory
    )

# Define a user message
usr_msg = 'what is information in your mind?'

# Sending the message to the agent
response = agent.step(usr_msg)

# Check the response (just for illustrative purpose)
print(response.msgs[0].content)

Solution

No response

Alternatives

No response

Additional context

No response

@lightaime lightaime added the enhancement New feature or request label Oct 9, 2024
@lightaime lightaime self-assigned this Oct 9, 2024
@Wendong-Fan Wendong-Fan assigned WHALEEYE and Wendong-Fan and unassigned lightaime Oct 18, 2024
@Wendong-Fan Wendong-Fan added this to the Sprint 15 milestone Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

3 participants