Skip to content

Conversation

xbotter
Copy link
Collaborator

@xbotter xbotter commented Dec 1, 2023

Breaking Changes

  • Refactored the chat completion implementation in LLamaSharpChatCompletion.cs to use StatelessExecutor instead of InteractiveExecutor.

Changes

  • Updated the chat history prompt in LLamaSharpChatCompletion.cs to include a conversation between the assistant and the user.
  • Modified the HistoryTransform class in HistoryTransform.cs to append the assistant role to the chat history prompt.
  • Updated the constructor of LLamaSharpChatCompletion to accept optional parameters for historyTransform and outputTransform.
  • Modified the GetChatCompletionsAsync and GetChatCompletions methods in LLamaSharpChatCompletion.cs to use the new StatelessExecutor and outputTransform.
  • Updated the ExtensionMethods.cs file to include the assistant and system roles in the list of anti-prompts.

Discussion

The current implementation refers to the handling method of History in LLamaSharp ChatSession, but the actual execution effect still needs to be combined with models and prompts.

xbotter and others added 2 commits December 1, 2023 21:39
- Refactored the chat completion implementation in `LLamaSharpChatCompletion.cs` to use `StatelessExecutor` instead of `InteractiveExecutor`.
- Updated the chat history prompt in `LLamaSharpChatCompletion.cs` to include a conversation between the assistant and the user.
- Modified the `HistoryTransform` class in `HistoryTransform.cs` to append the assistant role to the chat history prompt.
- Updated the constructor of `LLamaSharpChatCompletion` to accept optional parameters for `historyTransform` and `outputTransform`.
- Modified the `GetChatCompletionsAsync` and `GetChatCompletions` methods in `LLamaSharpChatCompletion.cs` to use the new `StatelessExecutor` and `outputTransform`.
- Updated the `ExtensionMethods.cs` file to include the assistant and system roles in the list of anti-prompts.
@SanftMonster
Copy link
Collaborator

Just for curiosity, will replacing InteractiveExecutor with StatelessExecutor improve the performance of SK chat?

@xbotter
Copy link
Collaborator Author

xbotter commented Dec 9, 2023

This will not bring any performance changes. It is just that using StatelessExecutor is more in line with the expectations of the current SK Chat interface.
The current SK ChatCompletion interface is more of a reference to OpenAI's API, providing the ability for stateless chat completion. Currently, there is indeed no suitable way to integrate stateful models.

@SanftMonster SanftMonster added enhancement New feature or request break change labels Dec 9, 2023
@SanftMonster SanftMonster merged commit 3019da9 into SciSharp:master Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

break change enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants