Make it possible to set extradata in preResponseEvent and pass it on

Created on 19 November 2024, 3 days ago

Problem/Motivation

Right now its hard to set data in the preResponseEvent that you might want to pass on to the postResponseEvent for logging reasons. We need a solution for that.

Useful for request time for instance.

Proposed resolution

  • Add a method to the PreGenerateResponseEvent called setState (or come up with a better name) that takes key and a mixed value.
  • Add a method to the PreGenerateResponseEvent called getStates that responds with an array of all data set in the setState.
  • Add a method to the PreGenerateResponseEvent called getState that takes a key and responds with mixed data set in setState.
  • Add a method to the PostGenerateResponseEvent called setState (or come up with a better name) that takes key and a mixed value.
  • Add a method to the PostGenerateResponseEvent called getStates that responds with an array of all data set in the setState.
  • Add a method to the PostGenerateResponseEvent called getState that takes a key and responds with mixed data set in setState.
  • Transfer the data from the PreGenerateResponseEvent getStates to PostGenerateResponseEvent setState so it can be transferred.

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

1.0

Component

AI Core module

Created by

🇩🇪Germany marcus_johansson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024