MyeongHoJeong commited on
Commit
534cedf
·
verified ·
1 Parent(s): cc4f5ae

docs: replace examples with inventory and verification workflows

Browse files
Files changed (1) hide show
  1. README.md +81 -56
README.md CHANGED
@@ -239,96 +239,121 @@ For CPU or Apple-silicon use, follow the download, build and server instructions
239
 
240
  ## Practical examples
241
 
242
- 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.
243
 
244
- ### Customer support: route, handoff and priority
245
 
246
- Run this in a second terminal after starting the server:
247
 
248
  ```bash
249
  curl --fail-with-body http://127.0.0.1:30171/v1/systemone \
250
  -H "Content-Type: application/json" --data-binary @- <<'JSON'
251
  {
252
- "state": "My account was charged twice. I have contacted support three times and want a person to help with the refund today.",
253
  "questions": {
254
- "team": {
255
  "type": "choice",
256
- "instructions": "Which team should handle this message?",
257
  "criteria": {
258
- "billing": "Charges, refunds and invoices",
259
- "technical": "Application errors and login problems",
260
- "other": "Requests outside billing and technical support"
261
  }
262
  },
263
- "handoff": {"type": "noul", "instructions": "Does the customer explicitly request a human agent?"},
264
- "priority": {
 
 
 
265
  "type": "score",
266
- "instructions": "How urgently should support review this request?",
267
- "criteria": ["Can wait", "Review today", "Service is blocked right now"]
 
 
 
 
268
  }
269
  }
270
  }
271
  JSON
272
  ```
273
 
274
- 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.
275
 
276
- ### Ticket routing, incident severity, agent completion and document routing
277
 
278
- 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.
279
 
280
  ```python
281
  import json
282
  from urllib.request import Request, urlopen
283
 
284
- def decide(state, questions):
 
285
  request = Request(
286
  "http://127.0.0.1:30171/v1/systemone",
287
- data=json.dumps({"state": state, "questions": questions}).encode("utf-8"),
288
  headers={"Content-Type": "application/json"},
289
  method="POST",
290
  )
291
  with urlopen(request, timeout=300) as response:
292
- return json.load(response)
293
-
294
- # Route a ticket to one queue from your own taxonomy.
295
- print(json.dumps(decide(
296
- "I cannot sign in after resetting my password. The reset link has expired.",
297
- {"queue": {"type": "choice", "instructions": "Which queue owns the ticket?",
298
- "criteria": {"account_access": "Login and password problems",
299
- "billing": "Payments and invoices",
300
- "bug_report": "Other application defects",
301
- "other": "None of these queues"}}}
302
- ), indent=2))
303
-
304
- # Score an ordered incident severity scale.
305
- print(json.dumps(decide(
306
- "Production checkout is unavailable for all customers. The incident is ongoing.",
307
- {"severity": {"type": "score", "instructions": "Assess the incident severity.",
308
- "criteria": ["Informational; no service impact",
309
- "Minor impact with a workaround",
310
- "Major degradation affecting some customers",
311
- "Critical outage affecting all customers"]}}
312
- ), indent=2))
313
-
314
- # Check an observed result against the original goal.
315
- print(json.dumps(decide(
316
- "Goal: send the weekly report to the team. Observed state: draft saved; the message has not been sent.",
317
- {"finished": {"type": "noul", "instructions": "Has the agent completed the goal?"}}
318
- ), indent=2))
319
-
320
- # Classify a document before selecting an extraction workflow.
321
- print(json.dumps(decide(
322
- "INVOICE 2048. Amount due: USD 240. Payment due within 30 days.",
323
- {"document_type": {"type": "choice", "instructions": "Classify the document.",
324
- "criteria": {"invoice": "A request for payment",
325
- "receipt": "Confirmation of completed payment",
326
- "meeting_notes": "Notes from a meeting",
327
- "other": "None of these document types"}}}
328
- ), indent=2))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
329
  ```
330
 
331
- 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.
332
 
333
  ## Files
334
 
 
239
 
240
  ## Practical examples
241
 
242
+ 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.
243
 
244
+ ### Warehouse receiving: reconcile a delivery record
245
 
246
+ 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.
247
 
248
  ```bash
249
  curl --fail-with-body http://127.0.0.1:30171/v1/systemone \
250
  -H "Content-Type: application/json" --data-binary @- <<'JSON'
251
  {
252
+ "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.",
253
  "questions": {
254
+ "receipt_action": {
255
  "type": "choice",
256
+ "instructions": "Select the next inventory step supported by the receiving note.",
257
  "criteria": {
258
+ "close_receipt": "The delivered quantity is reconciled and the count sheet is signed.",
259
+ "reconcile_count": "The recorded quantity differs from the order or pallet identification is unresolved.",
260
+ "await_delivery": "The shipment has not reached the receiving area."
261
  }
262
  },
263
+ "quantities_match": {
264
+ "type": "noul",
265
+ "instructions": "Do the receiving scan and purchase order report the same number of reels?"
266
+ },
267
+ "record_completeness": {
268
  "type": "score",
269
+ "instructions": "Evaluate how complete the receiving evidence is.",
270
+ "criteria": [
271
+ "No quantity or identification evidence is available.",
272
+ "Some evidence is recorded, but discrepancies or missing sign-off remain.",
273
+ "Quantities and identifiers are reconciled and sign-off is recorded."
274
+ ]
275
  }
276
  }
277
  }
278
  JSON
279
  ```
280
 
281
+ 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.
282
 
283
+ ### Python client
284
 
285
+ 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.
286
 
287
  ```python
288
  import json
289
  from urllib.request import Request, urlopen
290
 
291
+ def evaluate_record(record, questions):
292
+ payload = json.dumps({"state": record, "questions": questions}).encode("utf-8")
293
  request = Request(
294
  "http://127.0.0.1:30171/v1/systemone",
295
+ data=payload,
296
  headers={"Content-Type": "application/json"},
297
  method="POST",
298
  )
299
  with urlopen(request, timeout=300) as response:
300
+ print(json.dumps(json.load(response), indent=2))
301
+ ```
302
+
303
+ ### Data import: identify a column mismatch
304
+
305
+ An import monitor can classify a diagnostic record before selecting a repair playbook. This input contains rows, but the expected timestamp column is absent.
306
+
307
+ ```python
308
+ evaluate_record(
309
+ "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.",
310
+ {"failure_kind": {
311
+ "type": "choice",
312
+ "instructions": "Identify the import failure described in this diagnostic record.",
313
+ "criteria": {
314
+ "column_mismatch": "The available column names differ from the required schema.",
315
+ "empty_input": "The file contains no data rows.",
316
+ "text_encoding": "The importer cannot decode the file contents.",
317
+ "unresolved": "The record does not establish a failure category."
318
+ }
319
+ }}
320
+ )
321
+ ```
322
+
323
+ ### Equipment inspection: evaluate a filter reading
324
+
325
+ A maintenance log can map a written observation onto a defined condition scale. The criterion here is the gauge marking recorded by the inspector.
326
+
327
+ ```python
328
+ evaluate_record(
329
+ "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.",
330
+ {"filter_condition": {
331
+ "type": "score",
332
+ "instructions": "Assess the filter condition using the reported gauge position.",
333
+ "criteria": [
334
+ "The gauge is inside the normal operating band.",
335
+ "The gauge is above normal but below the replacement line.",
336
+ "The gauge has reached or exceeded the replacement line."
337
+ ]
338
+ }}
339
+ )
340
+ ```
341
+
342
+ ### Backup verification: compare evidence with an acceptance rule
343
+
344
+ 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.
345
+
346
+ ```python
347
+ evaluate_record(
348
+ "Archive B-206 was written to storage. Verification reported a checksum mismatch. A restore check has not been attempted.",
349
+ {"backup_verified": {
350
+ "type": "noul",
351
+ "instructions": "Does this record satisfy the rule that a verified backup must have a matching checksum AND a successful restore check?"
352
+ }}
353
+ )
354
  ```
355
 
356
+ 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.
357
 
358
  ## Files
359