Files
gateway/plugins
2024-05-28 14:12:36 +05:30
..
2024-05-28 14:12:36 +05:30
2024-05-28 14:12:36 +05:30
2024-05-28 14:12:36 +05:30
2024-05-28 14:12:36 +05:30
2024-05-13 16:47:08 -07:00
2024-05-13 16:47:08 -07:00

PluginContext should contain the following keys

{
  "hookType": "beforeRequestHook", // or `afterRequestHook`
  "request": {
    // The raw body of the incoming request
    "body": {},
    // Processed text by extracting the prompt or messages and putting them together
    "text": ""
  },
  "response": {
    // The raw body of the outgoing response
    "body": {},
    // Processed text by extracting the choices or messages and putting them together
    "text": ""
  },
}

Todos

  • Do plugin function evaluations support default values?
  • Plugins should handle finding the text
  • Plugins before being called should check if they support that particular hook type or should be skipped.
  • Will need to support enum names
  • Tools need to be supported on Portkey