Debugging / logging feature for prompt engineering

Created on 29 September 2023, over 1 year ago
Updated 14 May 2024, 8 months ago

Problem/Motivation

While getting this module configured, particularly the structure of the messages in the augmentors, it would be helpful to see the raw query sent to the AI service, as well as the result.

Proposed resolution

Add a logging option to augmentors, that would write these to the watchdog log.

Feature request
Status

Fixed

Version

1.1

Component

Code

Created by

🇨🇦Canada mandclu

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

Comments & Activities

  • Issue created by @mandclu
  • 🇱🇹Lithuania mindaugasd

    I have idea to create logger module which would log all AI requests (any contrib or custom module).
    The only thing needed is for modules to use guzzle and write a plugin.
    For example, I initiated this change in Augmentor to use Drupal client instead of curl 🐛 Consider using openai-php/client library Needs review and patch is already written.

    If you are interested I can create a project for this idea describing the scope.
    I think it is really interesting module.
    It would allow to configure pricing and calculate cost, define usage limits and similar things. Automatically handling any Drupal AI module (through guzzle middleware) which have also implemented a plugin (to calculate cost of requests).

    I already partly described this in https://www.drupal.org/project/aimodels module, but since that module is deprecated, there is a need for a separate module doing exactly logging functionality separately.

    This would also be very beneficial in collaboration between different modules, since it would a common functionality for every module without needing to invent the wheal each time.

  • Status changed to Fixed 9 months ago
  • 🇯🇵Japan eleonel Itoshima 🇯🇵

    I added a new checkbox to debug the input and output of augmentors.

    Thanks for your suggestion @mindaugasd but I think we don't need to create a sub-module for a basic input and output logging for a particular augmentor. Also now we have a "Preview" section on each augmentor where you can try and adjust your prompts in a quick way.

  • 🇯🇵Japan eleonel Itoshima 🇯🇵
    • eleonel committed 5098c978 on 1.1.x
      Issue #3390625: Debugging / logging feature for prompt engineering
      
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024