Hello,
I’ve been trying to get something going creating a custom GPT where I feed it an excel file, with 3 columns, (ID,Weight,Item Count) then to group it by certain constraints,
2 hard constraints
- no more than x weight per group
- no more than x count per group.
and a soft constraint of 4 IDs per group.
I’m using Google’s Function to run it through OR tools to solve for an LP problem and feed the info back to the GPT
It can ingest the file well, and keeps the records intact, but somehow whenever it calls the API, instead of using the verified data it had, it uses 5 records and then generates data for the rest.
Any suggestions on how to make sure the data ingested from the file is actually what gets sent over the API payload? Did I mess up the schema?
openapi: 3.1.0
info:
title: ID Grouping Optimization API
description: An API for optimizing the grouping of IDs for loading. Adheres to strict weight and count limits, while attempting to keep 4 IDs per load as a preferred, but flexible, constraint.
version: 1.0.0
servers:
- url: https://test.api.com
paths:
/optimize_po_grouping:
post:
operationId: optimizePoGrouping
summary: Optimize ID grouping for loading
description: Optimally groups IDs into loads while adhering to weight and count limits, and minimizing the number of loads. Attempts to keep 4 IDs per load when feasible.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
pos_data:
type: array
description: Array of IDs to be grouped
items:
type: object
properties:
id:
type: string
description: Unique identifier for the ID
counts:
type: integer
description: Number of counts for the ID
weight:
type: number
description: Weight of the ID in pounds
max_pallets:
type: integer
description: Maximum number of counts allowed per load
max_weight:
type: number
description: Maximum weight allowed per load in pounds
max_pos:
type: integer
description: Maximum number of IDs per load (soft constraint)
penalty_weight:
type: integer
description: Penalty for exceeding the preferred ID limit per load
responses:
'200':
description: Successfully optimized ID grouping
content:
application/json:
schema:
type: object
properties:
status:
type: string
description: Status of the optimization result
assignments:
type: array
description: List of optimized load assignments
items:
type: object
properties:
ID:
type: integer
description: ID number
IDs:
type: array
description: List of ID IDs assigned to this load
items:
type: string
Total Counts:
type: integer
description: Total counts on this load
Total Weight:
type: number
description: Total weight on this load
ID Count:
type: integer
description: Number of IDs on this load
example:
status: "Optimal solution found"
assignments:
- ID: 1
IDs: ["PO123", "PO124"]
Total Counts: 13
Total Weight: 22000
ID Count: 2
'400':
description: Invalid request
'500':
description: Server error or infeasible solution