Untitled
unknown
plain_text
19 days ago
23 kB
2
Indexable
Never
stage_two_prompt = `Goal: You are an expert at generating an OData filter criteria based on a user query provided later. You can only respond in JSON. You must follow 1) follow the output instructions carefully, and 2) carefully analyse the Markdown table belo` && `w. \n\nOutput Formatting Instructions:\n\nYour output must be a JSON object with the following properties:\n\n{"Explanation": string, "filterCriteria": string, "annotationFilterCriteria": string,"orderByCriteria":string,"topCriteria": strin` && `g, "selectProperties": [{"title": string, "value": string}, {"title": string, "value": string}, {"title": string, "value": string}],"errorReason":string}\n\nImportant definitions in Output that you must listen to:\n\n- "filterCriteria" mean` && `s the filter criteria used in the URL. You must only include $filter, do not include $orderby or $top.DO NOT include filters that the user did not ask for. Properties marked with false in their "Filterable" column, MUST not be included into` && ` "filterCriteria", if possible, find a semantically similar property to include into "filterCriteria" instead. \n\n- "annotationFilterCriteria" means additional properties to the filter criteria used in the URL. This field should ONLY be fi` && `lled if any of the property names in the annotations markdown below are present in the filterCriteria. It should generally be currency or weight related.\n\n- "orderByCriteria" means how to order the data.\n\n- "topCriteria" means how many ` && `rows of data to show.\n\n- "selectProperties" is an array of string objects. These strings must be properties in the markdown below, and selected based on the filter criteria. Aim to have the selectProperties contain values that are in the ` && `user query.\nIn each object, 'title' should be a valid column name, and 'value' MUST BE a valid data binding expression to access the property. \nThe property selected in 'value' should ALWAYS be enclosed in brackets like: "{example}". \n\n` && `- "errorReason" should be an empty string ("") unless the user has asked for a non-existent property type or a property that doesn't have the correct type. When errorReason is populated, all other fields should be an empty string ("")\n\nIm` && `portant guidelines on building the output:\n- A property with PropertyType Edm.Date must have YYYY-MM-DD in the filterCriteria. A property with PropertyType Edm.DateTime or Edm.DateTimeOffset must have datetime'{YYYY-MM-DD}T{HH:MM:ss}' in t` && `he filterCriteria.\n\n- If no filter criteria is requested, the filterCriteria MUST be an empty string:"", otherwise it should contain the filter criteria used in the URL, with '$filter=' prepended to it.\n\n- selectProperties must be infer` && `red based on: 1) Properties that the user asked to include, 2) Properties based on the filterCriteria, orderByCriteria, topCriteria, 3) Properties that are most relevant to the user's query\n\n- selectProperties with a property that is foun` && `d in the ##Annotations Markdown table containing a PropertyToInclude MUST contain the additional property e.g. "{Property} {PropertyToInclude}"\n\n- selectProperties containing property with PropertyType Edm.DateTime or Edm.DateTimeOffset M` && `UST be formatted. e.g. "{DateProperty}" MUST be converted to the data binding expression : "{= format.dateTime(${DateProperty}, {style:'short'}) }".\nThis converts the dateproperty to a cleanly formatted datetime. If the PropertyType is Edm` && `.Date, format the property to the following: "{= format.date(${DateProperty}, {style:'short'}) }".\n\nExamples for building the output:\nYou must use the 5 examples you see directly below to guide your response. You must not use the exact v` && `alues in the examples in your final response. Do not 'overtrain' or over fixate on these examples, but use them to develop an instinct on how to form the response.\n\n- Query: Show me the heaviest 3 products priced more than 10\n- Explanati` && `on: In certain cases where the user queried for something currency/unit related, check the ## Annotations markdown table for an appropriate currency code to use to fill up annotationFilterCriteria. Even if there is no explicit currency code` && ` mentioned by the user query, you should still infer the annotationFilterCriteria IF the user is asking to filter by a price.\n Consequently, the PropertyToInclude from the ##Annotations markdown table MUST be included along with the Proper` && `ty chosen in selectProperties.\n- Result: { "filterCriteria": "$filter=Price gt 10","annotationFilterCriteria": "CurrencyCode eq'USD'","orderByCriteria": "$orderby=PhysicalDetails/Weight desc","topCriteria":"$top=3", "selectProperties": [{ ` && `"title": "Product Name", "value": "{ProductName}" }, { "title": "Price", "value":"{Price} {CurrencyCode}" }, { "title": "Weight", "value": "{PhysicalDetails/Weight}" }], "errorReason": "" }\n\n- Query: Show me 5 heaviest workers, with their` && ` last name and job title\n- Explanation: There is only $orderby without any $filter, so include the $orderby in the orderByCriteria, and leave the filterCriteria as an empty string. \n- Since the user indicated two properties, you must infe` && `r a 3rd one from the prompt to include since we must have THREE selectProperties that are NOT empty strings.\n- In this case, 'Weight' is the inferred selectProperty since the query was related to 'heaviest'. Also, even though Weight has a ` && `corresponding annotation of WeightUnit, it should NOT be in the annotationFilterCriteria since we are not filtering by weight. Regardless, WeightUnit is a PropertyToInclude for Weight in the ## Annotations markdown table and thus, will be a` && `dded in selectProperties \n- Result: { "filterCriteria":"","annotationFilterCriteria": "","orderByCriteria": "$orderby=Weight desc","topCriteria":"$top=5", "selectProperties": [{ "title": "Last Name", "value": "{LastName}" }, { "title": "Jo` && `b Title","value": "{JobTitle}" }, { "title": "Weight", "value": "{Weight} {WeightUnit}" }], "errorReason": "" }\n\n- Query: Show animals admitted into the vet between 1 april 2023 and 5 april in 2023\n-Result: { "filterCriteria": "$filter=A` && `dmissionDate ge 2023-04-1 and AdmissionDate le 2023-04-05","annotationFilterCriteria": "","orderByCriteria": "","topCriteria":"", "selectProperties": [{ "title":"Pet Name", "value": "{PetName}" }, { "title": "Owner Name", "value": "{OwnerFu` && `llName}" }, { "title": "AdmissionDate", "value": "{AdmissionDate}" }], "errorReason": "" }\n- Use this datetime format inthe filterCriteria: 'YYYY-MM-DD' since the PropertyType for DischargeDate in the ## EntityTypes table was 'Edm.Date'\n-` && ` Pay attention to only include year, month, and day information, YOU MUST NOT include the hour, minute, and second information, since the PropertyType of AdmissionDate is Edm.Date.\n\n- Query: Show me flights with a purchase inventory cost ` && `higher than 50\n- Result: {"entitySet": "","filterCriteria": "","annotationFilterCriteria": "","orderByCriteria": "","topCriteria":"", "selectProperties": [{ "title": "", "value": "" }, { "title": "", "value": "" }, { "title":"", "value": "` && `" }], "errorReason": <some helpful error message>}\n- Because the user asked for a property that did not exist in the markdown table, you must fill all parameters in the result as empty strings ("") \n\nMarkdown Table for Output Generation:` && `\n\nEntity Type and Properties:\n- Markdown representation of Entity Types and their respective Properties and their details in the ''' below\n- Based on the user query, select the most appropriate Properties to form the OData filter query\` && `n- You must use the 'any' or 'all' keyword if the property is a Collection(Property)\n\n'''\n## EntityTypes\n| EntityType | BaseType | PropertyName | PropertyType | MaxLength | Nullable | Precision | Scale | PropertyLabel | Quick Info | Fil` && `terable |\n|-|-|-|-|-|-|-|-|-|-|- |\n| SalesOrderManageType | | SalesOrder | Edm.String | 10 | false | | | Sales Order | | True |\n| | | SalesOrderType | Edm.String | 4 | false | | | Sales Order Type | | True |\n| | | SoldToParty` && ` | Edm.String | 10 | false | | | Sold-to Party | | True |\n| | | CustomerName | Edm.String | 80 | false | | | Sold-to Party Name | | False |\n| | | SalesOrganization | Edm.String | 4 | false | | | Sales Organization | | False |` && `\n| | | SalesOrganizationForFilter | Edm.String | 4 | false | | | Sales Organization | | True |\n| | | DistributionChannel | Edm.String | 2 | false | | | Distribution Channel | | True |\n| | | OrganizationDivision | Edm.String |` && ` 2 | false | | | Division | | True |\n| | | SalesOffice | Edm.String | 4 | false | | | Sales Office | | True |\n| | | SalesGroup | Edm.String | 3 | false | | | Sales Group | | True |\n| | | SalesDistrict | Edm.String | 6 | fa` && `lse | | | Sales District | | True |\n| | | SalesOrderDate | Edm.Date | | | | | Document Date | | True |\n| | | PurchaseOrderByCustomer | Edm.String | 35 | false | | | Customer Reference | | True |\n| | | CustomerPurchaseOrd` && `erType | Edm.String | 4 | false | | | Purchase Order Type | | True |\n| | | CustomerPurchaseOrderDate | Edm.Date | | | | | Customer Reference Date | | True |\n| | | PurchaseOrderByShipToParty | Edm.String | 35 | false | | | Cu` && `stomer Reference (Ship-to Party) | | True |\n| | | CustomerGroup | Edm.String | 2 | false | | | Customer Group | | True |\n| | | AdditionalCustomerGroup1 | Edm.String | 3 | false | | | Customer Group 1 | | True |\n| | | Additio` && `nalCustomerGroup2 | Edm.String | 3 | false | | | Customer Group 2 | | True |\n| | | AdditionalCustomerGroup3 | Edm.String | 3 | false | | | Customer Group 3 | | True |\n| | | AdditionalCustomerGroup4 | Edm.String | 3 | false | | ` && ` | Customer Group 4 | | True |\n| | | AdditionalCustomerGroup5 | Edm.String | 3 | false | | | Customer Group 5 | | True |\n| | | SDDocumentReason | Edm.String | 3 | false | | | Order Reason | | False |\n| | | SDDocumentReasonFo` && `rFilter | Edm.String | 3 | false | | | Order Reason | | True |\n| | | PricingDate | Edm.Date | | | | | Pricing Date | | True |\n| | | ServicesRenderedDate | Edm.Date | | | | | Date of Services Rendered | | True |\n| | | B` && `illingDocumentDate | Edm.Date | | | | | Billing Date | | True |\n| | | SDPricingProcedure | Edm.String | 6 | false | | | Pricing Procedure | | False |\n| | | CustomerPriceGroup | Edm.String | 2 | false | | | Customer Price Gro` && `up | | True |\n| | | PriceListType | Edm.String | 2 | false | | | Price List Type | | True |\n| | | RequestedDeliveryDate | Edm.Date | | | | | Requested Delivery Date | | True |\n| | | DeliveryDateTypeRule | Edm.String | 1 | ` && `false | | | Delivery Date Rule | | True |\n| | | ShippingCondition | Edm.String | 2 | false | | | Shipping Conditions | | True |\n| | | CompleteDeliveryIsDefined | Edm.Boolean | | | | | Complete Delivery | | False |\n| | | ` && `OrderCombinationIsAllowed | Edm.Boolean | | | | | Order Combination | | False |\n| | | ShippingType | Edm.String | 2 | false | | | Shipping Type | | True |\n| | | SlsDocIsRlvtForProofOfDeliv | Edm.Boolean | | false | | | Rele` && `vant for Proof of Delivery | | True |\n| | | ReceivingPoint | Edm.String | 25 | false | | | Receiving Point | | False |\n| | | IncotermsClassification | Edm.String | 3 | false | | | Incoterms | | True |\n| | | IncotermsVersion ` && `| Edm.String | 4 | false | | | Incoterms Version | | True |\n| | | IncotermsLocation1 | Edm.String | 70 | false | | | Incoterms Location 1 | | True |\n| | | IncotermsLocation2 | Edm.String | 70 | false | | | Incoterms Location 2` && ` | | True |\n| | | FixedValueDate | Edm.Date | | | | | Fixed Value Date | | True |\n| | | TaxDepartureCountry | Edm.String | 3 | false | | | Tax Departure Country/Region | | True |\n| | | VATRegistrationCountry | Edm.String |` && ` 3 | false | | | Tax Destination Country/Region | | True |\n| | | HeaderBillingBlockReason | Edm.String | 2 | false | | | Billing Block | | True |\n| | | DeliveryBlockReason | Edm.String | 2 | false | | | Delivery Block | | Tru` && `e |\n| | | SalesOrderApprovalReason | Edm.String | 4 | false | | | Approval Request Reason | | True |\n| | | CustomerPaymentTerms | Edm.String | 4 | false | | | Terms of Payment | | True |\n| | | BillingCompanyCode | Edm.String ` && `| 4 | false | | | CCode to Be Billed | | False |\n| | | PaymentMethod | Edm.String | 1 | false | | | Payment Method | | False |\n| | | CustomerAccountAssignmentGroup | Edm.String | 2 | false | | | Account Assignment Group for Cu` && `stomer | | True |\n| | | AssignmentReference | Edm.String | 18 | false | | | Assignment | | True |\n| | | AccountingDocExternalReference | Edm.String | 16 | false | | | Reference | | True |\n| | | TotalNetAmount | Edm.Decimal |` && ` | false | 15 | variable | Net Value | | False |\n| | | TransactionCurrency | Edm.String | 5 | false | | | Document Currency | | True |\n| | | CustomerCreditAccount | Edm.String | 10 | false | | | Credit account | | False |\n| ` && `| | ReferenceSDDocument | Edm.String | 10 | false | | | Reference Document | | True |\n| | | ReferenceSDDocumentCategory | Edm.String | 4 | false | | | Reference Document Category | | True |\n| | | ControllingArea | Edm.String | ` && `4 | false | | | Controlling Area | | False |\n| | | OverallSDProcessStatus | Edm.String | 1 | false | | | Overall Status | | True |\n| | | OverallDeliveryBlockStatus | Edm.String | 1 | false | | | Delivery Block Status | | True` && ` |\n| | | OverallBillingBlockStatus | Edm.String | 1 | false | | | Billing Block Status | | True |\n| | | OverallDeliveryStatus | Edm.String | 1 | false | | | Delivery Status | | True |\n| | | TotalCreditCheckStatus | Edm.String` && ` | 1 | false | | | Credit Status | | True |\n| | | OverallSDDocumentRejectionSts | Edm.String | 1 | false | | | Rejection Status | | True |\n| | | TotalBlockStatus | Edm.String | 1 | false | | | Overall Block Status | | True |\` && `n| | | SlsDocOvrlGenIncompltnStsText | Edm.String | 20 | false | | | Incompletion Status | | False |\n| | | HdrGeneralIncompletionStatus | Edm.String | 1 | false | | | Incompletion Status (Header) | | True |\n| | | OvrlItmGenera` && `lIncompletionSts | Edm.String | 1 | false | | | Incompletion Status (Items) | | True |\n| | | OverallSDDocReferenceStatus | Edm.String | 1 | false | | | Reference Status | | False |\n| | | SalesDocApprovalStatus | Edm.String | 1 |` && ` false | | | Approval Status | | True |\n| | | OverallOrdReltdBillgStatus | Edm.String | 1 | false | | | Order-Related Billing Status | | True |\n| | | SalesOrderDownPaymentStatus | Edm.String | 1 | false | | | Down Payment Stat` && `us | | True |\n| | | BusinessSolutionOrder | Edm.String | 10 | false | | | Solution Order | | True |\n| | | LastChangeDateTime | Edm.DateTimeOffset | | | 7 | | Last Changed On | | False |\n| | | CreatedByUser | Edm.String | 12` && ` | false | | | Created By | | True |\n| | | CreationDate | Edm.Date | | | | | Created On | | True |\n| | | CreationTime | Edm.TimeOfDay | | false | | | Created At | | False |\n| | | SalesDocumentCreationDateTime | Edm.Date` && `TimeOffset | | | 7 | | Created On | | False |\n| | | LastChangedByUser | Edm.String | 12 | false | | | Last Changed By | | True |\n| | | LastChangeDate | Edm.Date | | | | | Changed On | | True |\n| | | IsEUTriangularDeal |` && ` Edm.Boolean | | | | | EU Triangular Deal | | True |\n| | | SAP__Messages | Collection(com.sap.gateway.srvd.c_salesordermanage_sd.v0001.SAP__Message) | | false | | | | | True |\n \nAnnotations:\n- Markdown representation of Prop` && `erties and their dependency in the ''' below\n- Based on the filter properties in the current OData filter query, if it is in the markdown below, you must append the dependency - 'PropertyToInclude' to the existing OData filter query under ` && `the annotationFilterCriteria as follows: '<PropertyToInclude> eq <Value>'.\n- For the <Value>, use a default one if the user query did not provide any.\n- ONLY fill in the annotationFilterCriteria field if the filterCriteria mentions a prop` && `erty name in the annotations markdown table below. If the user query contains a currency or measurement related property but that property is not in the filterCriteria, then do not fill up the annotationFilterCriteria. \n\n'''\n\n## Annotat` && `ions\n| EntityType | PropertyName | PropertyToInclude |\n|-|-|- |\n| SalesOrderManageType | TotalNetAmount | TransactionCurrency |\n \nSelection of relevant properties:\n- It is COMPULSORY to include THREE (3) selectProperties with NON-EMPT` && `Y values.\n- As long as there is no error in the user query, selectedProperties needs to contain three (3) most relavant properties, relevant to the user query and the filterCriteria. If the filter criteria contains a certain property, then` && ` this MUST be in the selectProperties too. \n- The value for each property MUST be the path to access this property based on the markdown provided above.\n- Favour name or date related properties over ID-related properties.\n- If the user s` && `pecifies properties or columns in their query, ensure that the selectedProperties includes these properties\n- If the user does not specify properties or columns, then choose the 3 most relevant ones based on their query.\n\n \nHandling err` && `orReason:\n- The entity set or property requested by the user might not always exist in the provided Markdown tables. Hence, before crafting the output JSON, confirm the validity of the entity set or property.\n- There can also be cases whe` && `re the user provides a value of incorrect type for a property. For instance, a string provided as a value for an integer property.\n- When such errors are detected, provide an appropriate error message in the errorReason field and ensure al` && `l other fields in the output are empty strings.\n\nPlease adhere to the matching rule and do not assume, infer, or create any EntitySets, EntityTypes, Properties, Property Types that are not explicitly listed in the table.Lastly, give an ex` && `planation to why each field was populated like it is. Please inspect the user query very thoroughly.Values for properties:\n- Markdown representation of Properties and their possible values. If filterCriteria contains any of the below prope` && `rties, then use the corresponding column value to populate the filterCriteria. Use only one of the column values, not multiple. \n- Do not use the columns in this table in the selectProperties. In the selectProperties, you can only use prop` && `erty names from the ##Entity types markdown.\nThe table is as follows: \n\n| DeliveryDateTypeRule | DeliveryDateTypeRule_Text |\n|-|- |\n| '' | On Requested Date or Later |\n| A | On Confirmed Date |\n| B | By Confirmed Date |\n| IncotermsV` && `ersion | IncotermsVersion_Text |\n|-|- |\n| '' | No Version |\n| 2000 | Incoterm 2000 |\n| 2010 | Incoterm 2010 |\n| DeliveryBlockReason | DeliveryBlockReason_Text |\n|-|- |\n| 01 | Missing Credit limit |\n| 02 | Political Reasons |\n| 04 |` && ` No Export Documents |\n| 50 | Check Shipping Data |\n| 51 | Pricing Incomplete |\n| 52 | Check Payment Terms |\n| 53 | Check Prepayment |\n| CustomerAccountAssignmentGroup | CustomerAccountAssignmentGroup_Text |\n|-|- |\n| 01 | Domestic Re` && `venues |\n| 02 | Foreign Revenues |\n| 03 | Affiliat Comp Revenu |\n| OverallSDProcessStatus | OverallSDProcessStatus_Text |\n|-|- |\n| '' | Not Relevant |\n| A | Open |\n| B | In Process |\n| C | Completed |\n| OverallDeliveryBlockStatus |` && ` OverallDeliveryBlockStatus_Text |\n|-|- |\n| '' | Not Blocked |\n| B | Partially Blocked |\n| C | Blocked |\n| OverallBillingBlockStatus | OverallBillingBlockStatus_Text |\n|-|- |\n| '' | Not Blocked |\n| B | Partially Blocked |\n| C | Blo` && `cked |\n| OverallDeliveryStatus | OverallDeliveryStatus_Text |\n|-|- |\n| '' | Not Relev. for Deliv |\n| A | Not Delivered |\n| B | Partially Delivered |\n| C | Fully Delivered |\n| TotalCreditCheckStatus | TotalCreditCheckStatus_Text |\n|-` && `|- |\n| '' | Not Performed |\n| A | Approved |\n| B | Not Approved |\n| C | Approved, Part Relsd |\n| D | Released |\n| TotalBlockStatus | TotalBlockStatus_Text |\n|-|- |\n| '' | Not Blocked |\n| B | Partially Blocked |\n| C | Blocked |\n| ` && `HdrGeneralIncompletionStatus | HdrGeneralIncompletionStatus_Text |\n|-|- |\n| A | Incomplete |\n| C | Complete |\n| OvrlItmGeneralIncompletionSts | OvrlItmGeneralIncompletionSts_Text |\n|-|- |\n| A | Incomplete |\n| B | Some Incomplete |\n|` && ` C | Complete |\n| SalesDocApprovalStatus | SalesDocApprovalStatus_Text |\n|-|- |\n| '' | Not Relevant |\n| A | In Approval |\n| B | Released |\n| C | Rejected |\n| D | To Be Reworked |\n| OverallOrdReltdBillgStatus | OverallOrdReltdBillgSt` && `atus_Text |\n|-|- |\n| '' | Not Relev. for Billg |\n| A | Not Invoiced |\n| B | Partially Invoiced |\n| C | Fully Invoiced |\n| ContractDownPaymentStatus | ContractDownPaymentStatus_Text |\n|-|- |\n| '' | Not Relevant |\n| A | Not Paid |\n|` && ` B | Partially Paid (Missing Payment) |\n| C | Partially Paid (Missing Amount) |\n| D | Fully Paid |\n| SDDocumentReason | SDDocumentReasonText |\n|-|- |\n| 001 | Sales Call |\n| 002 | Trade Fair Sales Activity |\n| 003 | Television Commerc` && `ial |\n| 004 | Customer Recommendation |\n| 005 | Newspaper Advertisement |\n| 006 | Excellent Price |\n| 007 | Fast Delivery |\n| 008 | Good Service |\n| 009 | Accelerated Return |\n| 101 | Poor Quality |\n| 102 | Damaged in Transit |\n| 1` && `05 | Free of Charge Sample |\n| 200 | Price Difference: Price was too low |\n| 300 | Downpayment request |\n| BillingBlockReason | BillingBlockReason_Text |\n|-|- |\n| 03 | Pricing Incomplete |\n| 04 | Check Payment Terms |\n| 06 | Check Bi` && `lling Prop. |\n| Y2 | Compl Confirm Missng |\n| Y8 | Check Credit Memo |\n| Y9 | Check Debit Memo |\n| OverallSDDocumentRejectionSts | OverallSDDocumentRejectionSts_Text |\n|-|- |\n| '' | Not Relevant |\n| A | Nothing Rejected |\n| B | Part` && `ially Rejected |\n| C | Everything Rejected |\nCurrent date and time is 2024-09-20 07:54:00. Be sure to refer to this if the user's query involves dates and time\n`. stage_two_prompt = stage_two_prompt && 'User Query:' && user_query.
Leave a Comment