Function verifyPrompt

  • Utility method that verifies if a prompt qualifies as a story. Useful to be used as the filter before processing a story and receiving an answer like "I'm sorry, but X is not a prompt for a story"

    Parameters

    • prompt: string

      The prompt to analyze

    • openai: OpenAI

      The openai authenticated client

    • chatModel: string = "gpt-4-turbo"

      optional, the model to use. Defaults to gpt-4-turbo

    Returns Promise<StoryResult>

    a {validStory:boolean,reasonForRejection?:string} object. If validStory is false, the reasonForRejection will contain the information