Protected Optional _configTrait instance configuration.
Protected _globalWhether this is a global (not bound to any specific schema item) trait instance.
Protected Readonly _graphqlProtected _runtimeProtected Optional _typeTrait type.
Protected Readonly dataProtected Readonly graphqlThe chatGPT resolver is the function that is called when the chatgpt field is called.
It calls the OpenAI API to get the response, using the input as the prompt.
It then returns the response, first choice, first text.
The response from OpenAI.
Datasource wrapper object.
The data object.
Attaches Trait callbacks to schema item hooks.
Makes this Trait instance global.
This method is triggered when a trait callback has been activated
This is the name of the callback function to call.
References to the Graph Hanlder
Request data passed along as part of the request.
ChatGPTTrait configuration setter.
This configuration object.
Helper method for wrapping legacy Kosmos traits callbacks.
TODO: Remove this method once all Traits are converted.
Optional callbackName: stringOptional callback name; passing this parameter will additionally wrap the callback into legacy process().
Static traitGenerated using TypeDoc
The ChatGPT trait adds
chatgptresolver to theQueryof the entities that its attached to.Usage:
Mermaid
ChatGPT Query