Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 30 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,30 @@ Read more on our [documentation page](https://suffolklitlab.org/docassemble-Asse
* https://github.com/SuffolkLitLab/docassemble-ThemeTemplate
* https://github.com/SuffolkLitLab/EfileProxyServer

## Documentation

https://suffolklitlab.org/docassemble-AssemblyLine-documentation/

## ALWeaver API

When installed on a docassemble server, ALWeaver exposes a custom Flask API:

- `POST /al/api/v1/weaver` (primary)
- `GET /al/api/v1/weaver/jobs/{job_id}` (async job polling)
- `DELETE /al/api/v1/weaver/jobs/{job_id}` (async job cleanup)
- `GET /al/api/v1/weaver/openapi.json` (OpenAPI spec)
- `GET /al/api/v1/weaver/docs` (human-readable docs)

The API uses docassemble's API key authentication via `api_verify()`.
The `POST` endpoint defaults to synchronous behavior, and supports optional
asynchronous execution with `mode=async` (or `async=true`).

To enable async mode, add this module to your docassemble configuration:

```yaml
celery modules:
- docassemble.ALWeaver.api_weaver_worker
```
## Documentation
https://suffolklitlab.org/docassemble-AssemblyLine-documentation/
## ALWeaver API
When installed on a docassemble server, ALWeaver exposes a custom Flask API:
- `POST /al/api/v1/weaver` (primary)
- `GET /al/api/v1/weaver/jobs/{job_id}` (async job polling)
- `DELETE /al/api/v1/weaver/jobs/{job_id}` (async job cleanup)
- `GET /al/api/v1/weaver/openapi.json` (OpenAPI spec)
- `GET /al/api/v1/weaver/docs` (human-readable docs)
The API uses docassemble's API key authentication via `api_verify()`.
The `POST` endpoint defaults to synchronous behavior, and supports optional
asynchronous execution with `mode=async` (or `async=true`).
To enable async mode, add this module to your docassemble configuration:
```yaml
celery modules:
- docassemble.ALWeaver.api_weaver_worker
```

## History

Expand All @@ -71,15 +71,10 @@ Nharika Singh

### Using auto drafting mode

As of June 2023, the Weaver includes auto drafting mode.

To use the automatic field grouping feature of auto drafting mode,
you need to install either:

1. The `en_core_web_lg` model on your server, or
2. An API token for tools.suffolklitlab.org.
To use auto-drafting mode, you can get an Open AI API Key and set it in
your docassemble configuration.

You can request an API token by emailing massaccess@suffolklitlab.org. If you
prefer to install your own copy of the `en_core_web_lg` model, you can
access it the first time you select to use auto drafting mode when logged
in as an administrator.
```yaml
open ai:
key: ...
```
3 changes: 0 additions & 3 deletions docassemble/ALWeaver/data/questions/assembly_line.yml
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,6 @@ code: |
jur=str(
get_config("assembly line", {}).get("pdf relabel jurisdiction", "MA")
),
tools_token=get_config("assembly line", {}).get(
"tools.suffolklitlab.org api key"
),
openai_api=get_config("open ai", {}).get("key"),
)
if isinstance(stats, dict) and isinstance(stats.get("fields"), list):
Expand Down
6 changes: 0 additions & 6 deletions docassemble/ALWeaver/data/questions/template_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,6 @@ code: |
jur="MA",
normalize=1,
rewrite=1,
tools_token=get_config("assembly line", {}).get(
"tools.suffolklitlab.org api key"
),
)
document.commit()
process_field_normalization = True
Expand All @@ -223,9 +220,6 @@ code: |
jur="MA",
normalize=1,
rewrite=1,
tools_token=get_config("assembly line", {}).get(
"tools.suffolklitlab.org api key"
),
)

temp_new_pdf.commit()
Expand Down
9 changes: 2 additions & 7 deletions docassemble/ALWeaver/interview_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3206,16 +3206,11 @@ def auto_group_fields(self):
try:
field_grouping = formfyxer.cluster_screens(
[field.variable for field in self.all_fields.custom()],
tools_token=get_config("assembly line", {}).get(
"tools.suffolklitlab.org api key", None
),
)
if not field_grouping:
field_grouping = self._null_group_fields()
except:
log(
f"Auto field grouping failed. Tried using tools.suffolklitlab.org api key {get_config('assembly line',{}).get('tools.suffolklitlab.org api key', None)}"
)
except Exception as ex:
log(f"Auto field grouping failed. {ex}")
field_grouping = self._null_group_fields()
self.field_grouping = field_grouping
self.questions.auto_gather = False
Expand Down
Loading