-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat: Index entities
- Loading branch information
Showing
13 changed files
with
1,436 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
diff --git a/src/MyPdf.php b/src/MyPdf.php | ||
index 082131a..bb3cb96 100644 | ||
--- a/src/MyPdf.php | ||
+++ b/src/MyPdf.php | ||
@@ -21,6 +21,7 @@ class MyPdf extends TCPDF | ||
protected $_transf = array(); | ||
protected $_myLastPageGroup = null; | ||
protected $_myLastPageGroupNb = 0; | ||
+ protected $tcpdflink = false; | ||
|
||
// used to make a radius with bezier : (4/3 * (sqrt(2) - 1)) | ||
const MY_ARC = 0.5522847498; | ||
@@ -267,7 +268,7 @@ class MyPdf extends TCPDF | ||
$cornerBL = null, | ||
$cornerBR = null | ||
) { | ||
- | ||
+ | ||
// init the path | ||
$path = ''; | ||
|
||
@@ -1087,7 +1088,7 @@ class MyPdf extends TCPDF | ||
$drawFirst = true, | ||
$trans = false | ||
) { | ||
- | ||
+ | ||
// if we want the no trigo direction : add 2PI to the begin angle, to invert the direction | ||
if (!$direction) { | ||
$angleBegin+= M_PI*2.; | ||
@@ -1387,7 +1388,7 @@ class MyPdf extends TCPDF | ||
$page = null, | ||
$fontName = 'helvetica' | ||
) { | ||
- | ||
+ | ||
// bookmark the Title if wanted | ||
if ($bookmarkTitle) { | ||
$this->Bookmark($titre, 0, -1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,3 +96,25 @@ XDEBUG_MODE=coverage vendor/bin/phpunit | |
# without coverage | ||
vendor/bin/phpunit | ||
``` | ||
|
||
## For dev | ||
|
||
```bash | ||
drush rapi-i --alias job --verbose | ||
drush rw-job:index --verbose | ||
|
||
cget ocha_ai.settings --include-overridden | ||
cget ocha_ai_tag.settings --include-overridden | ||
cget ocha_ai_chat.settings --include-overridden | ||
cget reliefweb_api.settings --include-overridden | ||
|
||
cset ocha_ai.settings plugins.source.reliefweb.api_url https://dev.api-reliefweb-int.ahconu.org/v1 | ||
cset ocha_ai.settings plugins.source.reliefweb.converter_url https://xxx:[email protected]/search/converter/json | ||
cset reliefweb_api.settings api_url https://dev.api-reliefweb-int.ahconu.org/v1 | ||
cset reliefweb_api.settings api_url_external https://dev.api-reliefweb-int.ahconu.org/v1 | ||
cset reliefweb_api.settings website: https://dev.reliefweb-int.ahconu.org | ||
|
||
queue:list | ||
queue:run --verbose reliefweb_job_tagger | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# ReliefWeb - Semantic module | ||
|
||
This module provides integration with the ReliefWeb Semantic API. | ||
|
||
## To do | ||
|
||
- [x] Add service to query API | ||
|
||
## AWS | ||
|
||
Dashboards: | ||
|
||
- https://us-east-1.console.aws.amazon.com/s3/lens/dashboard/RW-KB?region=us-east-1&bucketType=general | ||
|
||
Config: | ||
|
||
- Role: `BedrockRoleKbRw` | ||
- Collection: `arn:aws:aoss:us-east-1:694216630861:collection/b2h8ajgjb3x87ur892hc` | ||
- Vector field: `embedding` | ||
- Text field name: `AMAZON_BEDROCK_TEXT_CHUNK` | ||
- Metadata field name: `AMAZON_BEDROCK_METADATA` | ||
|
||
All content is using a single KB, current Id is `VIEPSPYNSS` | ||
|
||
## Drush | ||
|
||
```bash | ||
drush reliefweb-semantic:index Index content in the ReliefWeb API. | ||
drush reliefweb-semantic:list-kbs List kbs. | ||
drush reliefweb-semantic:list-datasources List datasources. | ||
drush reliefweb-semantic:list-jobs List ingestion jobs. | ||
drush reliefweb-semantic:trigger-sync Trigger sync.. | ||
drush reliefweb-semantic:query-kb --id=WYBGQOFQLN --q="Any jobs in Europe" | ||
drush reliefweb-semantic:list-apikeys | ||
``` | ||
|
||
## Openseach | ||
|
||
```json | ||
GET /bedrock-knowledge-base-default-index/_search | ||
{ | ||
"query": { | ||
"match_all": {} | ||
} | ||
} | ||
``` | ||
|
||
```json | ||
GET /bedrock-knowledge-base-default-index/_search | ||
{ | ||
"query": { | ||
"match": { | ||
"country": "*" | ||
} | ||
|
||
} | ||
} | ||
``` | ||
|
||
```json | ||
GET /bedrock-knowledge-base-default-index/_search | ||
{ | ||
"query": { | ||
"match": { | ||
"title": { | ||
"query": "china", | ||
"fuzziness": "AUTO" | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Questions | ||
|
||
- Describe the weather in china in june 2024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
services: | ||
reliefweb_semantic.commands: | ||
class: \Drupal\reliefweb_semantic\Commands\ReliefWebSemanticCommands | ||
arguments: ['@config.factory', '@entity_field.manager', '@entity_type.manager', '@module_handler', '@state', '@http_client', '@file_system', '@renderer'] | ||
tags: | ||
- { name: drush.command } | ||
reliefweb_semantic.aws_commands: | ||
class: \Drupal\reliefweb_semantic\Commands\ReliefWebSemanticAwsCommands | ||
arguments: ['@config.factory', '@state', '@reliefweb_semantic.search_service'] | ||
tags: | ||
- { name: drush.command } | ||
|
5 changes: 5 additions & 0 deletions
5
html/modules/custom/reliefweb_semantic/reliefweb_semantic.info.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
type: module | ||
name: ReliefWeb Semantic | ||
description: 'Provides integration with the ReliefWeb Semantic API.' | ||
package: reliefweb | ||
core_version_requirement: ^9 || ^10 |
Oops, something went wrong.