[meta] Where prompts will be used

Created on 20 July 2024, 2 months ago

Problem/Motivation

I am exploring how prompt system ( https://www.drupal.org/project/aiprompt ) could cover all the needs.

Proposed resolution

Cases:

  • Configure system message of any chat (of any assistant)
  • Configure prompt of AI automator
  • Use together with AI abstraction layer in code
  • Where else?

In detail:

Configure system message of any chat (of any assistant)

Configure prompt of AI automator

Use together with AI abstraction layer in code

Exact code example I am already using:

  $system_prompt = $prompt->toString();
  $input = new ChatInput([
    new ChatMessage("system", $system_prompt),
    new ChatMessage("user", "[...]"),
  ]);
  $ai_provider = \Drupal::service('ai.provider')->createInstance('openai');
  $response = $ai_provider->chat($input, 'gpt-4o')->getNormalized();
  $data = $this->processJsonAIResponse($response->getText());

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

1.0

Component

Discussion

Created by

🇱🇹Lithuania mindaugasd

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

Comments & Activities

Production build 0.71.5 2024