Skip to content

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

@SanftMonster SanftMonster 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!

@SanftMonster SanftMonster merged commit 16141ad into SciSharp:master Apr 30, 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