-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Hey @rohit-ganguly I bumped into an issue today because of this typing:
interface AIChatCompletionOptions {
context?: object;
sessionState?: unknown;
}Because of the object type, you can't index it on arbitrary property as TypeScript reports an error. Some linters like @typescript-eslint reports an error because of this type too.
The same issue also exists with the other context occurrences in AIChatCompletion, AIChatCompletionDelta, AIChatMessage, AIChatMessageDelta.
I recommend updating the type from object to Record<string, unknown> which solves the issues above. This is a common type used in TS for generic indexable objects.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels