DARPA-ASKEM / terarium

https://app.terarium.ai
Apache License 2.0
12 stars 2 forks source link

Create and save the summary object when GoLLM summary generation request completes. #3992

Closed jryu01 closed 1 week ago

jryu01 commented 1 week ago

Description

Create and save the summary object when GoLLM summary generation request completes.

Example:

Request

curl -X 'POST' \
  'http://localhost:3000/gollm/generate-summary?project-id=be4b4f45-a35c-4e23-a43d-aadd2ce54b9b' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer  ... ' \
  -H 'Content-Type: application/json' \
  -d '1 + 2 = 3. Summarize this.'

Response

{
  "id": "8b8569ac-95fe-4ff6-9b4b-77fe6ade4e6e",
  "script": "gollm_task:generate_summary",
  "status": "SUCCESS",
  "output": "eyJyZXNwb25zZSI6ICJUaGUgZXF1YXRpb24gXCIxICsgMiA9IDNcIiBpcyBhIHNpbXBsZSBhcml0aG1ldGljIGV4cHJlc3Npb24gZGVtb25zdHJhdGluZyB0aGUgYWRkaXRpb24gb2YgdHdvIG51bWJlcnMuIEl0IHNob3dzIHRoYXQgd2hlbiB5b3UgYWRkIHRoZSBudW1iZXIgMSB0byB0aGUgbnVtYmVyIDIsIHRoZSByZXN1bHQgaXMgMy4gVGhpcyBiYXNpYyBtYXRoZW1hdGljYWwgb3BlcmF0aW9uIGlzIGZvdW5kYXRpb25hbCBpbiBhcml0aG1ldGljIGFuZCBpcyBvZnRlbiBvbmUgb2YgdGhlIGZpcnN0IGNvbmNlcHRzIHRhdWdodCBpbiBlYXJseSBlZHVjYXRpb24uIn0=",
  "userId": "930b9501-ab07-4baf-b5c8-d4095dc82b3b",
  "projectId": "be4b4f45-a35c-4e23-a43d-aadd2ce54b9b",
  "additionalProperties": {
    "summaryId": "ec2ecefe-6611-4759-8075-301f3fa58fed"
  },
  "stdout": "Reading input from input pipe\nGenerating a response from input\nSending request to OpenAI API\nReceived response from OpenAI API\nWriting output to output pipe\nShutting down\n",
  "stderr": "",
  "requestSHA256": "SgrprLGdKDbkVYWSCMWfTK1h4cX0/TGKrin4/tvkgdE="
}

GET http://localhost:3000/summary/ec2ecefe-6611-4759-8075-301f3fa58fed?project-id=be4b4f45-a35c-4e23-a43d-aadd2ce54b9b

{
  "id": "ec2ecefe-6611-4759-8075-301f3fa58fed",
  "createdOn": "2024-06-26T20:24:55.534+00:00",
  "updatedOn": "2024-06-26T20:25:02.721+00:00",
  "fileNames": [],
  "temporary": false,
  "publicAsset": false,
  "generatedSummary": "The equation \"1 + 2 = 3\" is a simple arithmetic expression demonstrating the addition of two numbers. It shows that when you add the number 1 to the number 2, the result is 3. This basic mathematical operation is foundational in arithmetic and is often one of the first concepts taught in early education."
}

Waiting for https://github.com/DARPA-ASKEM/terarium/pull/3991 to be merged in first.

Resolves #(issue)