Skip to content

Commit

Permalink
Use AI to extract action points
Browse files Browse the repository at this point in the history
  • Loading branch information
attiks committed Oct 3, 2023
1 parent 75e3e3c commit 570de65
Show file tree
Hide file tree
Showing 26 changed files with 1,001 additions and 751 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ $config['ocha_ai_summarize.settings']['claude_api_key'] = 'zz';
```bash
drush queue:process ocha_ai_summarize_extract_text
drush queue:process ocha_ai_summarize_summarize
drush queue:process ocha_ai_summarize_action_points
```

We can either use cron to run the queues or run them separatly
Expand Down
22 changes: 22 additions & 0 deletions config/core.base_field_override.node.action_points.promote.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
uuid: 77ca281c-e187-4460-8307-6b20ede22edd
langcode: en
status: true
dependencies:
config:
- node.type.action_points
id: node.action_points.promote
field_name: promote
entity_type: node
bundle: action_points
label: 'Promoted to front page'
description: ''
required: false
translatable: true
default_value:
-
value: 0
default_value_callback: ''
settings:
on_label: 'On'
off_label: 'Off'
field_type: boolean
127 changes: 127 additions & 0 deletions config/core.entity_form_display.node.action_points.default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
uuid: b0a337d3-57d1-474e-ab26-2c94eaab3e43
langcode: en
status: true
dependencies:
config:
- field.field.node.action_points.field_action_points
- field.field.node.action_points.field_ai_brain
- field.field.node.action_points.field_automatic_mode
- field.field.node.action_points.field_document
- field.field.node.action_points.field_document_text
- node.type.action_points
module:
- content_moderation
- file
- path
- text
id: node.action_points.default
targetEntityType: node
bundle: action_points
mode: default
content:
created:
type: datetime_timestamp
weight: 8
region: content
settings: { }
third_party_settings: { }
field_action_points:
type: text_textarea
weight: 7
region: content
settings:
rows: 5
placeholder: ''
third_party_settings: { }
field_ai_brain:
type: options_select
weight: 2
region: content
settings: { }
third_party_settings: { }
field_automatic_mode:
type: boolean_checkbox
weight: 3
region: content
settings:
display_label: true
third_party_settings: { }
field_document:
type: file_generic
weight: 4
region: content
settings:
progress_indicator: throbber
third_party_settings: { }
field_document_text:
type: string_textarea
weight: 6
region: content
settings:
rows: 5
placeholder: ''
third_party_settings: { }
langcode:
type: language_select
weight: 1
region: content
settings:
include_locked: true
third_party_settings: { }
moderation_state:
type: moderation_state_default
weight: 13
region: content
settings: { }
third_party_settings: { }
path:
type: path
weight: 11
region: content
settings: { }
third_party_settings: { }
promote:
type: boolean_checkbox
weight: 9
region: content
settings:
display_label: true
third_party_settings: { }
status:
type: boolean_checkbox
weight: 14
region: content
settings:
display_label: true
third_party_settings: { }
sticky:
type: boolean_checkbox
weight: 10
region: content
settings:
display_label: true
third_party_settings: { }
title:
type: string_textfield
weight: 0
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 5
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
url_redirects:
weight: 12
region: content
settings: { }
third_party_settings: { }
hidden: { }
66 changes: 66 additions & 0 deletions config/core.entity_view_display.node.action_points.default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
uuid: 15038d49-cf49-4566-b9f7-6b14cbbf04e4
langcode: en
status: true
dependencies:
config:
- field.field.node.action_points.field_action_points
- field.field.node.action_points.field_ai_brain
- field.field.node.action_points.field_automatic_mode
- field.field.node.action_points.field_document
- field.field.node.action_points.field_document_text
- node.type.action_points
module:
- file
- options
- text
- user
id: node.action_points.default
targetEntityType: node
bundle: action_points
mode: default
content:
content_moderation_control:
settings: { }
third_party_settings: { }
weight: 4
region: content
field_action_points:
type: text_default
label: hidden
settings: { }
third_party_settings: { }
weight: 3
region: content
field_ai_brain:
type: list_default
label: inline
settings: { }
third_party_settings: { }
weight: 1
region: content
field_automatic_mode:
type: boolean
label: inline
settings:
format: default
format_custom_false: ''
format_custom_true: ''
third_party_settings: { }
weight: 0
region: content
field_document:
type: file_default
label: inline
settings:
use_description_as_link_text: true
third_party_settings: { }
weight: 2
region: content
links:
settings: { }
third_party_settings: { }
weight: 5
region: content
hidden:
field_document_text: true
langcode: true
31 changes: 31 additions & 0 deletions config/core.entity_view_display.node.action_points.teaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
uuid: 9977694b-b1f0-4006-b537-c9efd6eb76b7
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.node.teaser
- field.field.node.action_points.field_action_points
- field.field.node.action_points.field_ai_brain
- field.field.node.action_points.field_automatic_mode
- field.field.node.action_points.field_document
- field.field.node.action_points.field_document_text
- node.type.action_points
module:
- user
id: node.action_points.teaser
targetEntityType: node
bundle: action_points
mode: teaser
content:
links:
settings: { }
third_party_settings: { }
weight: 100
region: content
hidden:
field_action_points: true
field_ai_brain: true
field_automatic_mode: true
field_document: true
field_document_text: true
langcode: true
28 changes: 28 additions & 0 deletions config/field.field.node.action_points.field_action_points.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
uuid: 57e67950-2bea-4289-a1e5-253786d5fa77
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_action_points
- filter.format.text_editor_simple
- node.type.action_points
module:
- allowed_formats
- text
third_party_settings:
allowed_formats:
allowed_formats: { }
id: node.action_points.field_action_points
field_name: field_action_points
entity_type: node
bundle: action_points
label: 'Action points'
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings:
allowed_formats:
- text_editor_simple
field_type: text_long
23 changes: 23 additions & 0 deletions config/field.field.node.action_points.field_ai_brain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
uuid: 6aec51f7-796d-435c-8727-239d87fa5b0f
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_ai_brain
- node.type.action_points
module:
- options
id: node.action_points.field_ai_brain
field_name: field_ai_brain
entity_type: node
bundle: action_points
label: 'AI Brain'
description: ''
required: false
translatable: false
default_value:
-
value: openai
default_value_callback: ''
settings: { }
field_type: list_string
23 changes: 23 additions & 0 deletions config/field.field.node.action_points.field_automatic_mode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
uuid: ac2d157e-dc5e-4ee1-bd36-09dc56de7d00
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_automatic_mode
- node.type.action_points
id: node.action_points.field_automatic_mode
field_name: field_automatic_mode
entity_type: node
bundle: action_points
label: 'Automatic mode'
description: 'When enabled will automatically run the whole flow without any user interaction needed.'
required: false
translatable: false
default_value:
-
value: 1
default_value_callback: ''
settings:
on_label: 'On'
off_label: 'Off'
field_type: boolean
27 changes: 27 additions & 0 deletions config/field.field.node.action_points.field_document.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
uuid: 1c2155b9-7720-4954-96bf-9931ea26c918
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_document
- node.type.action_points
module:
- file
id: node.action_points.field_document
field_name: field_document
entity_type: node
bundle: action_points
label: Document
description: ''
required: true
translatable: false
default_value: { }
default_value_callback: ''
settings:
handler: 'default:file'
handler_settings: { }
file_directory: '[date:custom:Y]-[date:custom:m]'
file_extensions: 'pdf docx odt rtf'
max_filesize: ''
description_field: false
field_type: file
19 changes: 19 additions & 0 deletions config/field.field.node.action_points.field_document_text.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
uuid: afdce9d3-772e-445e-a4b6-7567f31c7f0c
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_document_text
- node.type.action_points
id: node.action_points.field_document_text
field_name: field_document_text
entity_type: node
bundle: action_points
label: 'Document text'
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: string_long
Loading

0 comments on commit 570de65

Please sign in to comment.