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

Unsafe overridden ToString on ChatCompletion #152

Open
isaacabraham opened this issue Jul 31, 2024 · 1 comment
Open

Unsafe overridden ToString on ChatCompletion #152

isaacabraham opened this issue Jul 31, 2024 · 1 comment

Comments

@isaacabraham
Copy link

This override crashes as soon as there is no content returned e.g. in the case of a FunctionTool response.

@sunnynagavo
Copy link

sunnynagavo commented Aug 9, 2024

may be change it to this ?

/// <summary>Returns the text of the first element in the Content collection, or an empty string if the collection is null or empty.</summary>
public override string ToString() => Content != null && Content.Count > 0 ? Content[0].Text : string.Empty;

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

No branches or pull requests

2 participants