Skip to content

Commit

Permalink
Merge pull request #6 from UN-OCHA/develop
Browse files Browse the repository at this point in the history
chore: Bake a main image, for stage.
  • Loading branch information
cafuego authored Oct 16, 2023
2 parents dd05c41 + 5f52381 commit 9be3c3c
Show file tree
Hide file tree
Showing 60 changed files with 3,258 additions and 1,048 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/composer-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
github_access_token: ${{ secrets.PAT }}
patch_branch: 'develop'
patch_packages: 'drupal/*'
patch_maintainers: ${{ secrets.DRUPAL_MAINTAINERS }}
patch_maintainers: ${{ vars.DRUPAL_MAINTAINERS }}
slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
slack_channel_name: ${{ secrets.SLACK_CHANNEL }}
flowdock_token: ${{ secrets.FLOWDOCK_TOKEN }}
slack_channel_name: ${{ vars.SLACK_CHANNEL }}
2 changes: 1 addition & 1 deletion .github/workflows/docker-build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
ecr_github_token: ${{ secrets.ECR_GITHUB_TOKEN }}
ecr_jenkins_token: ${{ secrets.JENKINS_ECR_TOKEN }}
slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
slack_channel_name: ${{ secrets.SLACK_CHANNEL }}
slack_channel_name: ${{ vars.SLACK_CHANNEL }}
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,41 @@

Uses AI to summarize PDF files

## Settings

```php
$config['ocha_ai_summarize.settings']['openai_token'] = 'xxx';

$config['ocha_ai_summarize.settings']['azure_endpoint'] = 'https://tst003.openai.azure.com/openai/deployments/tst003/chat/completions?api-version=2023-03-15-preview';
$config['ocha_ai_summarize.settings']['azure_apikey'] = 'yyy';

$config['ocha_ai_summarize.settings']['bedrock_endpoint'] = 'https://bedrock.us-east-1.amazonaws.com/model/amazon.titan-tg1-large/invoke';
$config['ocha_ai_summarize.settings']['bedrock_model'] = 'amazon.titan-tg1-large';
$config['ocha_ai_summarize.settings']['bedrock_access_key'] = 'x1';
$config['ocha_ai_summarize.settings']['bedrock_secret_key'] = 'x2';

$config['ocha_ai_summarize.settings']['claude_endpoint'] = 'https://api.anthropic.com/v1/complete';
$config['ocha_ai_summarize.settings']['claude_version'] = '2023-06-01';
$config['ocha_ai_summarize.settings']['claude_api_key'] = 'zz';
```

## Cron

```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

## Flow

1. User creates a new *Summary* node providing a title and a PDF file and which brain to use
2. A queue item is created to extract the text
3. `drush queue:process ocha_ai_summarize_extract_text`
4. The node is updated and the extracted text is added
5. A queue item is created to summarize the text
6. `drush queue:process ocha_ai_summarize_summarize`
7. The node is updated and the summary is added
8. User can proof-read and publish the node
31 changes: 0 additions & 31 deletions assets/docker-build-image.yml

This file was deleted.

13 changes: 13 additions & 0 deletions assets/robots.txt.append
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
# Sitemap

# Other people's AI.
User-agent: GPTBot
Disallow: /

User-agent: ChatGPT-User
Disallow: /

User-agent: Google-Extended
Disallow: /

User-agent: CCBot
Disallow: /
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
],
"require": {
"php": ">=8.1",
"aws/aws-sdk-php": "^3.281",
"composer/installers": "^1.12",
"cweagans/composer-patches": "^1.7",
"drupal/admin_denied": "^2.0",
Expand All @@ -39,6 +40,7 @@
"drupal/maintenance200": "^1.1",
"drupal/memcache": "^2.5",
"drupal/metatag": "^1.22",
"drupal/node_view_permissions": "^1.6",
"drupal/paragraphs": "^1.15",
"drupal/pathauto": "^1.8",
"drupal/queue_ui": "^3.1",
Expand All @@ -52,6 +54,7 @@
"drush/drush": "^11.3",
"oomphinc/composer-installers-extender": "^2.0",
"orakili/composer-drupal-info-file-patch-helper": "^1",
"phpoffice/phpword": "^1.1",
"unocha/common_design": "^7.4",
"webflo/drupal-finder": "^1.2.2"
},
Expand Down
Loading

0 comments on commit 9be3c3c

Please sign in to comment.