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

Participant #526

Merged
merged 14 commits into from
Jun 10, 2024
Merged

Participant #526

merged 14 commits into from
Jun 10, 2024

Conversation

pelikhan
Copy link
Member

@pelikhan pelikhan commented Jun 9, 2024

Library Changes

  • 🆕 Added a new type ChatParticipantHandler which is a function that takes an array of ChatCompletionMessageParam and returns a Promise<string>.
  • 🧩 Introduced chatParticipants as an array of ChatParticipantHandler in various parts of the codebase:
    • executeChatSession function in chat.ts now accepts chatParticipants as an additional parameter.
    • callExpander function in expander.ts now initializes and includes chatParticipants in its return object.
    • expandTemplate function in expander.ts now includes chatParticipants in its processing logic.
    • createPromptContext function in promptcontext.ts now provides a defChatParticipant method to define a chat participant.
    • PromptNode interface in promptdom.ts has a new type "chatParticipant" to represent chat participant nodes.
    • createChatParticipant function in promptdom.ts creates a new PromptChatParticipantNode.
    • renderPromptNode function in promptdom.ts now handles chatParticipant nodes and includes them in the PromptNodeRender interface.
    • runTemplate function in promptrunner.ts now includes chatParticipants in its execution flow.
    • createRunPromptContext function in runpromptcontext.ts now supports chatParticipants and includes them in the execution context.

CLI Changes

  • None of the changes directly affect the CLI interface; all changes are internal to the library's handling of chat participants within the code execution flow.

generated by genaiscript pr-describe

Copy link

github-actions bot commented Jun 9, 2024

LGTM 🚀

generated by genaiscript pr-review

packages/core/src/chat.ts Outdated Show resolved Hide resolved
packages/core/src/chat.ts Outdated Show resolved Hide resolved
@@ -111,6 +111,7 @@ async function callExpander(
let functions: ChatFunctionCallback[] = []
let fileMerges: FileMergeHandler[] = []
let outputProcessors: PromptOutputProcessorHandler[] = []
let chatParticipants: ChatParticipantHandler[] = []
Copy link

Choose a reason for hiding this comment

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

The chatParticipants parameter should be placed after aici to match the order in the function signature.

generated by genaiscript pr-review-commit

packages/core/src/chat.ts Outdated Show resolved Hide resolved
@pelikhan pelikhan marked this pull request as ready for review June 10, 2024 12:42
@pelikhan pelikhan merged commit 5c4331b into main Jun 10, 2024
7 of 9 checks passed
@pelikhan pelikhan deleted the participant branch June 10, 2024 15:56
- Be concise.
- Use simple language.
- use emojis.
`

Choose a reason for hiding this comment

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

Could you structure the output to jsonl format

Copy link
Member Author

Choose a reason for hiding this comment

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

oh good one. let me see if i can add support for JSONL in outputs.

@pelikhan pelikhan mentioned this pull request Jun 10, 2024
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.

2 participants