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

[SDK/CLI] Add chat group poc #2249

Merged
merged 15 commits into from
Mar 13, 2024
Merged

[SDK/CLI] Add chat group poc #2249

merged 15 commits into from
Mar 13, 2024

Conversation

0mza987
Copy link
Contributor

@0mza987 0mza987 commented Mar 7, 2024

Description

Add chat group sdk poc:

from promptflow._sdk.entities._chat_group._chat_group import ChatGroup
from promptflow._sdk.entities._chat_group._chat_role import ChatRole

copilot = ChatRole(
    flow=FLOWS_DIR / "chat_group_copilot",
    role="assistant",
    inputs=dict(
        question=topic,
        model="gpt-3.5-turbo",
        conversation_history="${parent.conversation_history}",
    ),
)
simulation = ChatRole(
    flow=FLOWS_DIR / "chat_group_simulation",
    role="user",
    inputs=dict(
        topic=topic,
        persona="criticizer",
        conversation_history="${parent.conversation_history}",
    ),
)

chat_group = ChatGroup(
    roles=[copilot, simulation],
    max_turns=4,
    max_tokens=1000,
    max_time=1000,
    stop_signal="[STOP]",
)
chat_group.invoke()

# history has 4 records
history = chat_group.conversation_history
assert len(history) == 4
assert history[0][0] == history[2][0] == copilot.role
assert history[1][0] == history[3][0] == simulation.role

All Promptflow Contribution checklist:

  • The pull request does not introduce [breaking changes].
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request to get dedicated review from promptflow team. Learn more: suggested workflow.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copy link

github-actions bot commented Mar 7, 2024

SDK CLI Global Config Test Result hod/chat_group

2 tests   2 ✅  49s ⏱️
1 suites  0 💤
1 files    0 ❌

Results for commit 38a0779.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Mar 7, 2024

promptflow-tracing unit test result hod/chat_group

 4 files   4 suites   22s ⏱️
 4 tests  4 ✅ 0 💤 0 ❌
16 runs  16 ✅ 0 💤 0 ❌

Results for commit 38a0779.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Mar 7, 2024

Executor Unit Test Result hod/chat_group

754 tests   754 ✅  47s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit 31695d0.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Mar 7, 2024

promptflow SDK CLI Azure E2E Test Result hod/chat_group

  4 files    4 suites   3m 51s ⏱️
168 tests 149 ✅ 19 💤 0 ❌
672 runs  596 ✅ 76 💤 0 ❌

Results for commit 38a0779.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Mar 7, 2024

Executor E2E Test Result hod/chat_group

211 tests   209 ✅  8m 26s ⏱️
  1 suites    2 💤
  1 files      0 ❌

Results for commit 31695d0.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Mar 7, 2024

SDK CLI Test Result hod/chat_group

   12 files     12 suites   40m 23s ⏱️
  456 tests   438 ✅ 18 💤 0 ❌
1 824 runs  1 752 ✅ 72 💤 0 ❌

Results for commit 38a0779.

♻️ This comment has been updated with latest results.

@0mza987 0mza987 changed the title [SDK/CLI][POC] Add chat group poc [SDK/CLI][WIP] Add chat group poc Mar 7, 2024
Copy link

github-actions bot commented Mar 11, 2024

promptflow-tracing e2e test result hod/chat_group

 4 files   4 suites   1m 38s ⏱️
 8 tests  8 ✅ 0 💤 0 ❌
32 runs  32 ✅ 0 💤 0 ❌

Results for commit 38a0779.

♻️ This comment has been updated with latest results.

@0mza987 0mza987 changed the title [SDK/CLI][WIP] Add chat group poc [SDK/CLI] Add chat group poc Mar 12, 2024
@0mza987 0mza987 merged commit 39a9f8c into main Mar 13, 2024
47 checks passed
@0mza987 0mza987 deleted the hod/chat_group branch March 13, 2024 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
promptflow sdk prompt flow SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants