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

Optional IHistoryTransform added to ChatSession.InitializeSessionFromHistoryAsync #711

Merged
merged 2 commits into from
Apr 30, 2024

Conversation

Norne9
Copy link
Contributor

@Norne9 Norne9 commented Apr 29, 2024

This pull request introduces an optional parameter, IHistoryTransform? transform, to the InitializeSessionFromHistoryAsync method in the ChatSession class. This change accommodates models that require specific formatting of the chat history.

Some language models may require the chat history to be formatted in a specific way before being passed to the model for generating a response. The addition of the IHistoryTransform parameter allows for the flexibility to apply custom transformations to the chat history when initializing a new session.

This change maintains backward compatibility with existing code that does not provide a custom history transform by making the transform parameter optional and defaulting it to null.

Norne9 added 2 commits April 30, 2024 02:32
ChatSession.InitializeSessionFromHistoryAsync now accepts IHistoryTransform as an optional parameter.
Optional IHistoryTransform added to ChatSession.InitializeSessionFromHistoryAsync
Copy link
Collaborator

@AsakusaRinne AsakusaRinne left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for the contribution!

@AsakusaRinne AsakusaRinne merged commit 16141ad into SciSharp:master Apr 30, 2024
4 checks passed
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