MyeongHoJeong commited on
Commit
7037b58
·
verified ·
1 Parent(s): 5557317

docs: replace examples with inventory and verification workflows

Browse files
Files changed (1) hide show
  1. README.md +79 -69
README.md CHANGED
@@ -250,111 +250,121 @@ For CPU or Apple-silicon use, follow the download, build and server instructions
250
 
251
  ## Practical examples
252
 
 
253
 
254
- Use the running server at `http://127.0.0.1:30171/v1/systemone`. SH scores all questions jointly without generating text. These examples are illustrative workloads, not measured accuracy results; inspect the actual response on your chosen model and quantization.
255
-
256
-
257
- ### Customer support: route, handoff and priority
258
-
259
-
260
- Run this in a second terminal after starting the server:
261
 
 
262
 
263
  ```bash
264
  curl --fail-with-body http://127.0.0.1:30171/v1/systemone \
265
  -H "Content-Type: application/json" --data-binary @- <<'JSON'
266
  {
267
- "state": "My account was charged twice. I have contacted support three times and want a person to help with the refund today.",
268
  "questions": {
269
- "team": {
270
  "type": "choice",
271
- "instructions": "Which team should handle this message?",
272
  "criteria": {
273
- "billing": "Charges, refunds and invoices",
274
- "technical": "Application errors and login problems",
275
- "other": "Requests outside billing and technical support"
276
  }
277
  },
278
- "handoff": {"type": "noul", "instructions": "Does the customer explicitly request a human agent?"},
279
- "priority": {
 
 
 
280
  "type": "score",
281
- "instructions": "How urgently should support review this request?",
282
- "criteria": ["Can wait", "Review today", "Service is blocked right now"]
 
 
 
 
283
  }
284
  }
285
  }
286
  JSON
287
  ```
288
 
 
289
 
290
- The intended routing label here is `billing`, with a human handoff. This describes the task, not a promised model output. `choice` selects from supplied categories; `noul` scores a yes/no question; `score` uses an ordered scale and returns an expected zero-based level that can be fractional.
291
-
292
-
293
- ### Ticket routing, incident severity, agent completion and document routing
294
-
295
-
296
- This Python client uses only the standard library and prints the complete server response. The requests work with the BF16 reference server and the SH GGUF runner on port 30171.
297
 
 
298
 
299
  ```python
300
  import json
301
  from urllib.request import Request, urlopen
302
 
303
-
304
- def decide(state, questions):
305
  request = Request(
306
  "http://127.0.0.1:30171/v1/systemone",
307
- data=json.dumps({"state": state, "questions": questions}).encode("utf-8"),
308
  headers={"Content-Type": "application/json"},
309
  method="POST",
310
  )
311
  with urlopen(request, timeout=300) as response:
312
- return json.load(response)
313
-
314
-
315
- # Route a ticket to one queue from your own taxonomy.
316
- print(json.dumps(decide(
317
- "I cannot sign in after resetting my password. The reset link has expired.",
318
- {"queue": {"type": "choice", "instructions": "Which queue owns the ticket?",
319
- "criteria": {"account_access": "Login and password problems",
320
- "billing": "Payments and invoices",
321
- "bug_report": "Other application defects",
322
- "other": "None of these queues"}}}
323
- ), indent=2))
324
-
325
-
326
- # Score an ordered incident severity scale.
327
- print(json.dumps(decide(
328
- "Production checkout is unavailable for all customers. The incident is ongoing.",
329
- {"severity": {"type": "score", "instructions": "Assess the incident severity.",
330
- "criteria": ["Informational; no service impact",
331
- "Minor impact with a workaround",
332
- "Major degradation affecting some customers",
333
- "Critical outage affecting all customers"]}}
334
- ), indent=2))
335
-
336
-
337
- # Check an observed result against the original goal.
338
- print(json.dumps(decide(
339
- "Goal: send the weekly report to the team. Observed state: draft saved; the message has not been sent.",
340
- {"finished": {"type": "noul", "instructions": "Has the agent completed the goal?"}}
341
- ), indent=2))
342
-
343
-
344
- # Classify a document before selecting an extraction workflow.
345
- print(json.dumps(decide(
346
- "INVOICE 2048. Amount due: USD 240. Payment due within 30 days.",
347
- {"document_type": {"type": "choice", "instructions": "Classify the document.",
348
- "criteria": {"invoice": "A request for payment",
349
- "receipt": "Confirmation of completed payment",
350
- "meeting_notes": "Notes from a meeting",
351
- "other": "None of these document types"}}}
352
- ), indent=2))
353
  ```
354
 
 
 
 
355
 
356
- Each `choice` question selects one category. For independent tags, submit one `noul` question per tag in the same request. Choose probability thresholds on representative validation data before automating routing or handoff. These examples use text input, the validated path for this release.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
 
 
358
 
359
  ## Files
360
 
 
250
 
251
  ## Practical examples
252
 
253
+ The following invented records illustrate four integrations: receiving inventory, diagnosing an import failure, evaluating an inspection note, and checking backup evidence. They are example inputs, not benchmark results. Start either the reference server or the SH GGUF runner on port 30171 before sending them.
254
 
255
+ ### Warehouse receiving: reconcile a delivery record
 
 
 
 
 
 
256
 
257
+ An inventory application can ask several questions about one receiving note. Here, the model compares the recorded quantities and checks whether the paperwork supports closing the receipt.
258
 
259
  ```bash
260
  curl --fail-with-body http://127.0.0.1:30171/v1/systemone \
261
  -H "Content-Type: application/json" --data-binary @- <<'JSON'
262
  {
263
+ "state": "Purchase order R-417 lists 48 cable reels. The receiving scan recorded 46 reels. Two pallet tags cannot be read, and the receiver has not signed the count sheet.",
264
  "questions": {
265
+ "receipt_action": {
266
  "type": "choice",
267
+ "instructions": "Select the next inventory step supported by the receiving note.",
268
  "criteria": {
269
+ "close_receipt": "The delivered quantity is reconciled and the count sheet is signed.",
270
+ "reconcile_count": "The recorded quantity differs from the order or pallet identification is unresolved.",
271
+ "await_delivery": "The shipment has not reached the receiving area."
272
  }
273
  },
274
+ "quantities_match": {
275
+ "type": "noul",
276
+ "instructions": "Do the receiving scan and purchase order report the same number of reels?"
277
+ },
278
+ "record_completeness": {
279
  "type": "score",
280
+ "instructions": "Evaluate how complete the receiving evidence is.",
281
+ "criteria": [
282
+ "No quantity or identification evidence is available.",
283
+ "Some evidence is recorded, but discrepancies or missing sign-off remain.",
284
+ "Quantities and identifiers are reconciled and sign-off is recorded."
285
+ ]
286
  }
287
  }
288
  }
289
  JSON
290
  ```
291
 
292
+ This record describes an unresolved count, unequal quantities and partial paperwork. Use those facts to inspect the returned answers. A `choice` question compares the descriptions you provide, a `noul` question returns a yes/no probability, and a `score` question returns an expected position on its ordered, zero-based scale. The score can lie between two levels.
293
 
294
+ ### Python client
 
 
 
 
 
 
295
 
296
+ Use this small standard-library client for the remaining examples. It displays the response as received so that you can examine the selected values and probability estimates.
297
 
298
  ```python
299
  import json
300
  from urllib.request import Request, urlopen
301
 
302
+ def evaluate_record(record, questions):
303
+ payload = json.dumps({"state": record, "questions": questions}).encode("utf-8")
304
  request = Request(
305
  "http://127.0.0.1:30171/v1/systemone",
306
+ data=payload,
307
  headers={"Content-Type": "application/json"},
308
  method="POST",
309
  )
310
  with urlopen(request, timeout=300) as response:
311
+ print(json.dumps(json.load(response), indent=2))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312
  ```
313
 
314
+ ### Data import: identify a column mismatch
315
+
316
+ An import monitor can classify a diagnostic record before selecting a repair playbook. This input contains rows, but the expected timestamp column is absent.
317
 
318
+ ```python
319
+ evaluate_record(
320
+ "Import job J-82 read 1,200 CSV rows. Required column event_time was not found. The file contains a column named timestamp_ms. UTF-8 decoding succeeded.",
321
+ {"failure_kind": {
322
+ "type": "choice",
323
+ "instructions": "Identify the import failure described in this diagnostic record.",
324
+ "criteria": {
325
+ "column_mismatch": "The available column names differ from the required schema.",
326
+ "empty_input": "The file contains no data rows.",
327
+ "text_encoding": "The importer cannot decode the file contents.",
328
+ "unresolved": "The record does not establish a failure category."
329
+ }
330
+ }}
331
+ )
332
+ ```
333
+
334
+ ### Equipment inspection: evaluate a filter reading
335
+
336
+ A maintenance log can map a written observation onto a defined condition scale. The criterion here is the gauge marking recorded by the inspector.
337
+
338
+ ```python
339
+ evaluate_record(
340
+ "Inspection of ventilation unit V-12: the filter pressure gauge is above the marked replacement line. The fan guard is secured and the housing has no visible cracks.",
341
+ {"filter_condition": {
342
+ "type": "score",
343
+ "instructions": "Assess the filter condition using the reported gauge position.",
344
+ "criteria": [
345
+ "The gauge is inside the normal operating band.",
346
+ "The gauge is above normal but below the replacement line.",
347
+ "The gauge has reached or exceeded the replacement line."
348
+ ]
349
+ }}
350
+ )
351
+ ```
352
+
353
+ ### Backup verification: compare evidence with an acceptance rule
354
+
355
+ A backup catalog can check whether a verification record satisfies a supplied rule. This example requires both a matching checksum and a successful restore check.
356
+
357
+ ```python
358
+ evaluate_record(
359
+ "Archive B-206 was written to storage. Verification reported a checksum mismatch. A restore check has not been attempted.",
360
+ {"backup_verified": {
361
+ "type": "noul",
362
+ "instructions": "Does this record satisfy the rule that a verified backup must have a matching checksum AND a successful restore check?"
363
+ }}
364
+ )
365
+ ```
366
 
367
+ These calls only request decisions; the surrounding application decides what to do with them. Measure accuracy and choose probability thresholds using records from your own workflow. All examples send text, which is the validated input path for these releases.
368
 
369
  ## Files
370