참고소스 수정본
This commit is contained in:
@@ -0,0 +1,118 @@
|
||||
# ruff: noqa: E501
|
||||
import os
|
||||
|
||||
from .optional_prompts import (
|
||||
OPTIONAL_INSTRUCTIONS_CHAT_MODEL,
|
||||
OPTIONAL_MSG_HISTORY,
|
||||
OPTIONAL_PROMPT_CHAT_MODEL,
|
||||
OPTIONAL_PROMPT_COMPLETION_MODEL,
|
||||
)
|
||||
from .pydantic_models import (
|
||||
INSTRUCTIONS_CHAT_MODEL,
|
||||
PROMPT,
|
||||
PROMPT_CHAT_MODEL,
|
||||
ContractDetailsFilter,
|
||||
ContractDetailsFix,
|
||||
ContractDetailsNoop,
|
||||
ContractDetailsReask,
|
||||
ContractDetailsRefrain,
|
||||
)
|
||||
from .validated_output_filter import VALIDATED_OUTPUT_FILTER
|
||||
from .validated_output_fix import VALIDATED_OUTPUT_FIX
|
||||
from .validated_output_noop import VALIDATED_OUTPUT_NOOP
|
||||
from .validated_output_reask_1 import VALIDATED_OUTPUT_REASK_1
|
||||
from .validated_output_reask_2 import VALIDATED_OUTPUT_REASK_2
|
||||
from .validated_output_refrain import VALIDATED_OUTPUT_REFRAIN
|
||||
from .validated_output_skeleton_reask_1 import VALIDATED_OUTPUT_SKELETON_REASK_1
|
||||
from .validated_output_skeleton_reask_2 import VALIDATED_OUTPUT_SKELETON_REASK_2
|
||||
|
||||
DATA_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)))
|
||||
reader = (
|
||||
lambda filename: open(os.path.join(DATA_DIR, filename)).read().replace("\r", "")
|
||||
)
|
||||
|
||||
# Compiled prompts
|
||||
COMPILED_PROMPT = reader("compiled_prompt.txt")
|
||||
NON_OPENAI_COMPILED_PROMPT = reader("non_openai_compiled_prompt.txt")
|
||||
COMPILED_PROMPT_WITHOUT_INSTRUCTIONS = reader(
|
||||
"compiled_prompt_without_instructions.txt"
|
||||
)
|
||||
COMPILED_PROMPT_REASK = reader("compiled_prompt_reask.txt")
|
||||
NON_OPENAI_COMPILED_PROMPT_REASK = reader("non_openai_compiled_prompt_reask.txt")
|
||||
COMPILED_PROMPT_REASK_WITHOUT_INSTRUCTIONS = reader(
|
||||
"compiled_prompt_reask_without_instructions.txt"
|
||||
)
|
||||
COMPILED_PROMPT_FULL_REASK = reader("compiled_prompt_full_reask.txt")
|
||||
COMPILED_INSTRUCTIONS = reader("compiled_instructions.txt")
|
||||
COMPILED_INSTRUCTIONS_REASK = reader("compiled_instructions_reask.txt")
|
||||
COMPILED_PROMPT_SKELETON_REASK_1 = reader("compiled_prompt_skeleton_reask_1.txt")
|
||||
COMPILED_PROMPT_SKELETON_REASK_2 = reader("compiled_prompt_skeleton_reask_2.txt")
|
||||
COMPILED_MSG_HISTORY = [
|
||||
{"role": "system", "content": COMPILED_INSTRUCTIONS},
|
||||
{"role": "user", "content": COMPILED_PROMPT_WITHOUT_INSTRUCTIONS},
|
||||
]
|
||||
|
||||
# LLM outputs
|
||||
LLM_OUTPUT = reader("llm_output.txt")
|
||||
LLM_OUTPUT_REASK = reader("llm_output_reask.txt")
|
||||
LLM_OUTPUT_FULL_REASK = reader("llm_output_full_reask.txt")
|
||||
LLM_OUTPUT_SKELETON_REASK_1 = reader("llm_output_skeleton_reask_1.txt")
|
||||
LLM_OUTPUT_SKELETON_REASK_2 = reader("llm_output_skeleton_reask_2.txt")
|
||||
|
||||
# Rail specs
|
||||
RAIL_SPEC_WITH_FILTER = reader("filter.rail")
|
||||
RAIL_SPEC_WITH_FIX = reader("fix.rail")
|
||||
RAIL_SPEC_WITH_NOOP = reader("noop.rail")
|
||||
RAIL_SPEC_WITH_REASK = reader("reask.rail")
|
||||
RAIL_SPEC_WITH_SKELETON_REASK = reader("skeleton_reask.rail")
|
||||
RAIL_SPEC_WITH_REFRAIN = reader("refrain.rail")
|
||||
RAIL_SPEC_WITH_FIX_CHAT_MODEL = reader("fix_chat_model.rail")
|
||||
|
||||
# Rail specs without prompts and instructions
|
||||
RAIL_SPEC_WITH_REASK_NO_PROMPT = reader("reask_without_prompt.rail")
|
||||
|
||||
# Pydantic models
|
||||
PYDANTIC_RAIL_WITH_FILTER = ContractDetailsFilter
|
||||
PYDANTIC_RAIL_WITH_FIX = ContractDetailsFix
|
||||
PYDANTIC_RAIL_WITH_NOOP = ContractDetailsNoop
|
||||
PYDANTIC_RAIL_WITH_REASK = ContractDetailsReask
|
||||
PYDANTIC_RAIL_WITH_REFRAIN = ContractDetailsRefrain
|
||||
PYDANTIC_PROMPT = PROMPT
|
||||
PYDANTIC_PROMPT_CHAT_MODEL = PROMPT_CHAT_MODEL
|
||||
PYDANTIC_INSTRUCTIONS_CHAT_MODEL = INSTRUCTIONS_CHAT_MODEL
|
||||
|
||||
|
||||
__all__ = [
|
||||
"COMPILED_PROMPT",
|
||||
"NON_OPENAI_COMPILED_PROMPT",
|
||||
"COMPILED_PROMPT_WITHOUT_INSTRUCTIONS",
|
||||
"COMPILED_PROMPT_REASK",
|
||||
"NON_OPENAI_COMPILED_PROMPT_REASK",
|
||||
"COMPILED_PROMPT_REASK_WITHOUT_INSTRUCTIONS",
|
||||
"COMPILED_INSTRUCTIONS",
|
||||
"COMPILED_INSTRUCTIONS_REASK",
|
||||
"COMPILED_MSG_HISTORY",
|
||||
"COMPILED_MSG_HISTORY_PROMPT",
|
||||
"LLM_OUTPUT",
|
||||
"LLM_OUTPUT_REASK",
|
||||
"PYDANTIC_INSTRUCTIONS",
|
||||
"PYDANTIC_PROMPT",
|
||||
"RAIL_SPEC_WITH_FILTER",
|
||||
"RAIL_SPEC_WITH_FIX",
|
||||
"RAIL_SPEC_WITH_FIX_CHAT_MODEL",
|
||||
"RAIL_SPEC_WITH_NOOP",
|
||||
"RAIL_SPEC_WITH_REASK",
|
||||
"RAIL_SPEC_WITH_REFRAIN",
|
||||
"VALIDATED_OUTPUT_FILTER",
|
||||
"VALIDATED_OUTPUT_FIX",
|
||||
"VALIDATED_OUTPUT_NOOP",
|
||||
"VALIDATED_OUTPUT_REASK_1",
|
||||
"VALIDATED_OUTPUT_REASK_2",
|
||||
"VALIDATED_OUTPUT_REFRAIN",
|
||||
"VALIDATED_OUTPUT_SKELETON_REASK_1",
|
||||
"VALIDATED_OUTPUT_SKELETON_REASK_2",
|
||||
"OPTIONAL_PROMPT_COMPLETION_MODEL",
|
||||
"OPTIONAL_PROMPT_CHAT_MODEL",
|
||||
"OPTIONAL_INSTRUCTIONS_CHAT_MODEL",
|
||||
"OPTIONAL_MSG_HISTORY",
|
||||
]
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
You are a helpful assistant only capable of communicating with valid JSON, and no other text.
|
||||
|
||||
|
||||
ONLY return a valid JSON object (no other text is necessary), where the key of the field in JSON is the `name` attribute of the corresponding XML, and the value is of the type specified by the corresponding XML's tag. The JSON MUST conform to the XML format, including any types and format requests e.g. requests for lists, objects and specific types. Be correct and concise. If you are unsure anywhere, enter `null`.
|
||||
|
||||
Here are examples of simple (XML, JSON) pairs that show the expected behavior:
|
||||
- `<string name='foo' format='two-words lower-case' />` => `{'foo': 'example one'}`
|
||||
- `<list name='bar'><string format='upper-case' /></list>` => `{"bar": ['STRING ONE', 'STRING TWO', etc.]}`
|
||||
- `<object name='baz'><string name="foo" format="capitalize two-words" /><integer name="index" format="1-indexed" /></object>` => `{'baz': {'foo': 'Some String', 'index': 1}}`
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
You are a helpful assistant only capable of communicating with valid JSON, and no other text.
|
||||
|
||||
ONLY return a valid JSON object (no other text is necessary), where the key of the field in JSON is the `name` attribute of the corresponding XML, and the value is of the type specified by the corresponding XML's tag. The JSON MUST conform to the XML format, including any types and format requests e.g. requests for lists, objects and specific types. Be correct and concise. If you are unsure anywhere, enter `null`.
|
||||
|
||||
Here are examples of simple (XML, JSON) pairs that show the expected behavior:
|
||||
- `<string name='foo' format='two-words lower-case' />` => `{'foo': 'example one'}`
|
||||
- `<list name='bar'><string format='upper-case' /></list>` => `{"bar": ['STRING ONE', 'STRING TWO', etc.]}`
|
||||
- `<object name='baz'><string name="foo" format="capitalize two-words" /><integer name="index" format="1-indexed" /></object>` => `{'baz': {'foo': 'Some String', 'index': 1}}`
|
||||
@@ -0,0 +1,131 @@
|
||||
|
||||
Given the following document, answer the following questions. If the answer doesn't exist in the document, enter 'None'.
|
||||
|
||||
2/25/23, 7:59 PM about:blank
|
||||
about:blank 1/4
|
||||
PRICING INFORMATION
|
||||
INTEREST RATES AND INTEREST CHARGES
|
||||
Purchase Annual
|
||||
Percentage Rate (APR) 0% Intro APR for the first 18 months that your Account is open.
|
||||
After that, 19.49%. This APR will vary with the market based on the Prime
|
||||
Rate.
|
||||
a
|
||||
My Chase Loan
|
||||
SM APR 19.49%. This APR will vary with the market based on the Prime Rate.
|
||||
a
|
||||
Promotional offers with fixed APRs and varying durations may be available from
|
||||
time to time on some accounts.
|
||||
Balance Transfer APR 0% Intro APR for the first 18 months that your Account is open.
|
||||
After that, 19.49%. This APR will vary with the market based on the Prime
|
||||
Rate.
|
||||
a
|
||||
Cash Advance APR 29.49%. This APR will vary with the market based on the Prime Rate.
|
||||
b
|
||||
Penalty APR and When
|
||||
It Applies
|
||||
Up to 29.99%. This APR will vary with the market based on the Prime Rate.
|
||||
c
|
||||
We may apply the Penalty APR to your account if you:
|
||||
fail to make a Minimum Payment by the date and time that it is due; or
|
||||
make a payment to us that is returned unpaid.
|
||||
How Long Will the Penalty APR Apply?: If we apply the Penalty APR for
|
||||
either of these reasons, the Penalty APR could potentially remain in effect
|
||||
indefinitely.
|
||||
How to Avoid Paying
|
||||
Interest on Purchases
|
||||
Your due date will be a minimum of 21 days after the close of each billing cycle.
|
||||
We will not charge you interest on new purchases if you pay your entire balance
|
||||
or Interest Saving Balance by the due date each month. We will begin charging
|
||||
interest on balance transfers and cash advances on the transaction date.
|
||||
Minimum Interest
|
||||
Charge
|
||||
None
|
||||
Credit Card Tips from
|
||||
the Consumer Financial
|
||||
Protection Bureau
|
||||
To learn more about factors to consider when applying for or using a credit card,
|
||||
visit the website of the Consumer Financial Protection Bureau at
|
||||
http://www.consumerfinance.gov/learnmore.
|
||||
FEES
|
||||
Annual Membership
|
||||
Fee
|
||||
None
|
||||
My Chase Plan
|
||||
SM Fee
|
||||
(fixed finance charge)
|
||||
Monthly fee of 0% of the amount of each eligible purchase transaction or
|
||||
amount selected to create a My Chase Plan while in the 0% Intro Purchase
|
||||
APR period.
|
||||
After that, monthly fee of 1.72% of the amount of each eligible purchase
|
||||
transaction or amount selected to create a My Chase Plan. The My Chase Plan
|
||||
Fee will be determined at the time each My Chase Plan is created and will
|
||||
remain the same until the My Chase Plan is paid in full.
|
||||
d
|
||||
Transaction Fees
|
||||
Balance Transfers Intro fee of either $5 or 3% of the amount of each transfer, whichever is greater,
|
||||
on transfers made within 60 days of account opening. After that: Either $5 or 5%
|
||||
of the amount of each transfer, whichever is greater.
|
||||
Cash Advances Either $10 or 5% of the amount of each transaction, whichever is greater.
|
||||
2/25/23, 7:59 PM about:blank
|
||||
about:blank 2/4
|
||||
Foreign Transactions 3% of the amount of each transaction in U.S. dollars.
|
||||
Penalty Fees
|
||||
Late Payment Up to $40.
|
||||
Over-the-Credit-Limit None
|
||||
Return Payment Up to $40.
|
||||
Return Check None
|
||||
Note: This account may not be eligible for balance transfers.
|
||||
Loss of Intro APR: We will end your introductory APR if any required Minimum Payment is 60 days late, and
|
||||
apply the Penalty APR.
|
||||
How We Will Calculate Your Balance: We use the daily balance method (including new transactions).
|
||||
Prime Rate: Variable APRs are based on the 7.75% Prime Rate as of 2/7/2023.
|
||||
aWe add 11.74% to the Prime Rate to determine the Purchase/My Chase Loan/Balance Transfer APR.
|
||||
Maximum APR 29.99%.
|
||||
bWe add 21.74% to the Prime Rate to determine the Cash Advance APR. Maximum APR 29.99%.
|
||||
cWe add up to 26.99% to the Prime Rate to determine the Penalty APR. Maximum APR 29.99%.
|
||||
dMy Chase Plan Fee: The My Chase Plan Fee is calculated at the time each plan is created and is based on
|
||||
the amount of each purchase transaction or amount selected to create the plan, the number of billing periods
|
||||
you choose to pay the balance in full, and other factors. The monthly and aggregate dollar amount of your My
|
||||
Chase Plan Fee will be disclosed during the activation of each My Chase Plan.
|
||||
MILITARY LENDING ACT NOTICE: Federal law provides important protections to members of the Armed
|
||||
Forces and their dependents relating to extensions of consumer credit. In general, the cost of consumer credit
|
||||
to a member of the Armed Forces and his or her dependent may not exceed an annual percentage rate of 36
|
||||
percent. This rate must include, as applicable to the credit transaction or account: the costs associated with
|
||||
credit insurance premiums; fees for ancillary products sold in connection with the credit transaction; any
|
||||
application fee charged (other than certain application fees for specified credit transactions or accounts); and
|
||||
any participation fee charged (other than certain participation fees for a credit card account). To receive this
|
||||
information and a description of your payment obligation verbally, please call 1-800-235-9978.
|
||||
TERMS & CONDITIONS
|
||||
Authorization: When you respond to this credit card offer from JPMorgan Chase Bank, N.A., Member FDIC, a
|
||||
subsidiary of JPMorgan Chase & Co. ("Chase", "we", or "us"), you agree to the following:
|
||||
1. You authorize us to obtain credit bureau reports, employment, and income information about you that we
|
||||
will use when considering your application for credit. We may obtain and use information about your
|
||||
accounts with us and others such as Checking, Deposit, Investment, and Utility accounts from credit
|
||||
bureaus and other entities. You also authorize us to obtain credit bureau reports and any other
|
||||
information about you in connection with: 1) extensions of credit on your account; 2) the administration,
|
||||
review or collection of your account; and 3) offering you enhanced or additional products and services. If
|
||||
you ask, we will tell you the name and address of the credit bureau from which we obtained a report
|
||||
about you.
|
||||
2. If an account is opened, you will receive a Cardmember Agreement with your card(s). You agree to the
|
||||
terms of this agreement by: using the account or any card, authorizing their use, or making any payment
|
||||
on the account.
|
||||
3. By providing your mobile ph
|
||||
|
||||
|
||||
Given below is XML that describes the information to extract from this document and the tags to extract it into.
|
||||
|
||||
|
||||
<output>
|
||||
<list description="What fees and charges are associated with my account?" name="fees" required="true">
|
||||
<object required="true">
|
||||
<integer format="1-indexed" name="index" required="true"></integer>
|
||||
<string format="lower-case; two-words" name="name" required="true"></string>
|
||||
<string format="one-line" name="explanation" required="true"></string>
|
||||
<float format="percentage" name="value" required="true"></float>
|
||||
</object>
|
||||
</list>
|
||||
<object description="What are the interest rates offered by the bank on savings and checking accounts, loans, and credit products?" name="interest_rates" required="true"></object>
|
||||
</output>
|
||||
|
||||
|
||||
ONLY return a valid JSON object (no other text is necessary). The JSON MUST conform to the XML format, including any types and format requests e.g. requests for lists, objects and specific types. Be correct and concise.
|
||||
@@ -0,0 +1,112 @@
|
||||
|
||||
I was given the following JSON response, which had problems due to incorrect values.
|
||||
|
||||
{
|
||||
"fees": [
|
||||
{
|
||||
"index": 1,
|
||||
"name": "annual membership",
|
||||
"explanation": "Annual Membership Fee",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"index": 2,
|
||||
"name": {
|
||||
"incorrect_value": "my chase plan",
|
||||
"error_messages": [
|
||||
"must be exactly two words"
|
||||
]
|
||||
},
|
||||
"explanation": "My Chase Plan Fee (fixed finance charge)",
|
||||
"value": 1.72
|
||||
},
|
||||
{
|
||||
"index": 3,
|
||||
"name": "balance transfers",
|
||||
"explanation": "Balance Transfers Intro fee of either $5 or 3% of the amount of each transfer, whichever is greater, on transfers made within 60 days of account opening. After that: Either $5 or 5% of the amount of each transfer.",
|
||||
"value": 5.0
|
||||
},
|
||||
{
|
||||
"index": 4,
|
||||
"name": "cash advances",
|
||||
"explanation": "Cash Advances Either $10 or 5% of the amount of each transaction, whichever is greater.",
|
||||
"value": 5.0
|
||||
},
|
||||
{
|
||||
"index": 5,
|
||||
"name": "foreign transactions",
|
||||
"explanation": "Foreign Transactions 3% of the amount of each transaction in U.S. dollars.",
|
||||
"value": 3.0
|
||||
},
|
||||
{
|
||||
"index": 6,
|
||||
"name": "late payment",
|
||||
"explanation": "Late Payment Up to $40.",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"index": 7,
|
||||
"name": {
|
||||
"incorrect_value": "over-the-credit-limit",
|
||||
"error_messages": [
|
||||
"must be exactly two words"
|
||||
]
|
||||
},
|
||||
"explanation": "Over-the-Credit-Limit None",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"index": 8,
|
||||
"name": "return payment",
|
||||
"explanation": "Return Payment Up to $40.",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"index": 9,
|
||||
"name": "return check",
|
||||
"explanation": "Return Check None",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"interest_rates": {
|
||||
"purchase": {
|
||||
"apr": 0,
|
||||
"explanation": "Purchase Annual Percentage Rate (APR) 0% Intro APR for the first 18 months that your Account is open. After that, 19.49%. This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"my_chase_loan": {
|
||||
"apr": 19.49,
|
||||
"explanation": "My Chase Loan SM APR 19.49%. This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"balance_transfer": {
|
||||
"apr": 0,
|
||||
"explanation": "Balance Transfer APR 0% Intro APR for the first 18 months that your Account is open. After that, 19.49%. This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"cash_advance": {
|
||||
"apr": 29.49,
|
||||
"explanation": "Cash Advance APR 29.49%. This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"penalty": {
|
||||
"apr": 29.99,
|
||||
"explanation": "Up to 29.99%. This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"maximum_apr": 29.99
|
||||
}
|
||||
}
|
||||
|
||||
Help me correct the incorrect values based on the given error messages.
|
||||
|
||||
Given below is XML that describes the information to extract from this document and the tags to extract it into.
|
||||
|
||||
<output>
|
||||
<list description="What fees and charges are associated with my account?" name="fees" required="true">
|
||||
<object required="true">
|
||||
<integer format="1-indexed" name="index" required="true"></integer>
|
||||
<string format="lower-case; two-words" name="name" required="true"></string>
|
||||
<string format="one-line" name="explanation" required="true"></string>
|
||||
<float format="percentage" name="value" required="true"></float>
|
||||
</object>
|
||||
</list>
|
||||
<object description="What are the interest rates offered by the bank on savings and checking accounts, loans, and credit products?" name="interest_rates" required="true"></object>
|
||||
</output>
|
||||
|
||||
ONLY return a valid JSON object (no other text is necessary), where the key of the field in JSON is the `name` attribute of the corresponding XML, and the value is of the type specified by the corresponding XML's tag. The JSON MUST conform to the XML format, including any types and format requests e.g. requests for lists, objects and specific types. Be correct and concise. If you are unsure anywhere, enter `null`.
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
I was given the following JSON response, which had problems due to incorrect values.
|
||||
|
||||
{
|
||||
"fees": [
|
||||
{
|
||||
"name": {
|
||||
"incorrect_value": "my chase plan",
|
||||
"error_messages": [
|
||||
"must be exactly two words"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"incorrect_value": "over-the-credit-limit",
|
||||
"error_messages": [
|
||||
"must be exactly two words"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Help me correct the incorrect values based on the given error messages.
|
||||
|
||||
Given below is XML that describes the information to extract from this document and the tags to extract it into.
|
||||
|
||||
<output>
|
||||
<list description="What fees and charges are associated with my account?" name="fees" required="true">
|
||||
<object required="true">
|
||||
<integer format="1-indexed" name="index" required="true"></integer>
|
||||
<string format="lower-case; two-words" name="name" required="true"></string>
|
||||
<string format="one-line" name="explanation" required="true"></string>
|
||||
<float format="percentage" name="value" required="true"></float>
|
||||
</object>
|
||||
</list>
|
||||
<object description="What are the interest rates offered by the bank on savings and checking accounts, loans, and credit products?" name="interest_rates" required="true"></object>
|
||||
</output>
|
||||
|
||||
ONLY return a valid JSON object (no other text is necessary), where the key of the field in JSON is the `name` attribute of the corresponding XML, and the value is of the type specified by the corresponding XML's tag. The JSON MUST conform to the XML format, including any types and format requests e.g. requests for lists, objects and specific types. Be correct and concise. If you are unsure anywhere, enter `null`.
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
I was given the following JSON response, which had problems due to incorrect values.
|
||||
|
||||
{
|
||||
"fees": [
|
||||
{
|
||||
"name": {
|
||||
"incorrect_value": "my chase plan",
|
||||
"error_messages": [
|
||||
"must be exactly two words"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"incorrect_value": "over-the-credit-limit",
|
||||
"error_messages": [
|
||||
"must be exactly two words"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Help me correct the incorrect values based on the given error messages.
|
||||
|
||||
Given below is XML that describes the information to extract from this document and the tags to extract it into.
|
||||
|
||||
<output>
|
||||
<list description="What fees and charges are associated with my account?" name="fees" required="true">
|
||||
<object required="true">
|
||||
<integer format="1-indexed" name="index" required="true"></integer>
|
||||
<string format="lower-case; two-words" name="name" required="true"></string>
|
||||
<string format="one-line" name="explanation" required="true"></string>
|
||||
<float format="percentage" name="value" required="true"></float>
|
||||
</object>
|
||||
</list>
|
||||
<object description="What are the interest rates offered by the bank on savings and checking accounts, loans, and credit products?" name="interest_rates" required="true"></object>
|
||||
</output>
|
||||
|
||||
ONLY return a valid JSON object (no other text is necessary), where the key of the field in JSON is the `name` attribute of the corresponding XML, and the value is of the type specified by the corresponding XML's tag. The JSON MUST conform to the XML format, including any types and format requests e.g. requests for lists, objects and specific types. Be correct and concise. If you are unsure anywhere, enter `null`.
|
||||
@@ -0,0 +1,131 @@
|
||||
|
||||
Given the following document, answer the following questions. If the answer doesn't exist in the document, enter
|
||||
'None'.
|
||||
|
||||
2/25/23, 7:59 PM about:blank
|
||||
about:blank 1/4
|
||||
PRICING INFORMATION
|
||||
INTEREST RATES AND INTEREST CHARGES
|
||||
Purchase Annual
|
||||
Percentage Rate (APR) 0% Intro APR for the first 18 months that your Account is open.
|
||||
After that, 19.49%. This APR will vary with the market based on the Prime
|
||||
Rate.
|
||||
a
|
||||
My Chase Loan
|
||||
SM APR 19.49%. This APR will vary with the market based on the Prime Rate.
|
||||
a
|
||||
Promotional offers with fixed APRs and varying durations may be available from
|
||||
time to time on some accounts.
|
||||
Balance Transfer APR 0% Intro APR for the first 18 months that your Account is open.
|
||||
After that, 19.49%. This APR will vary with the market based on the Prime
|
||||
Rate.
|
||||
a
|
||||
Cash Advance APR 29.49%. This APR will vary with the market based on the Prime Rate.
|
||||
b
|
||||
Penalty APR and When
|
||||
It Applies
|
||||
Up to 29.99%. This APR will vary with the market based on the Prime Rate.
|
||||
c
|
||||
We may apply the Penalty APR to your account if you:
|
||||
fail to make a Minimum Payment by the date and time that it is due; or
|
||||
make a payment to us that is returned unpaid.
|
||||
How Long Will the Penalty APR Apply?: If we apply the Penalty APR for
|
||||
either of these reasons, the Penalty APR could potentially remain in effect
|
||||
indefinitely.
|
||||
How to Avoid Paying
|
||||
Interest on Purchases
|
||||
Your due date will be a minimum of 21 days after the close of each billing cycle.
|
||||
We will not charge you interest on new purchases if you pay your entire balance
|
||||
or Interest Saving Balance by the due date each month. We will begin charging
|
||||
interest on balance transfers and cash advances on the transaction date.
|
||||
Minimum Interest
|
||||
Charge
|
||||
None
|
||||
Credit Card Tips from
|
||||
the Consumer Financial
|
||||
Protection Bureau
|
||||
To learn more about factors to consider when applying for or using a credit card,
|
||||
visit the website of the Consumer Financial Protection Bureau at
|
||||
http://www.consumerfinance.gov/learnmore.
|
||||
FEES
|
||||
Annual Membership
|
||||
Fee
|
||||
None
|
||||
My Chase Plan
|
||||
SM Fee
|
||||
(fixed finance charge)
|
||||
Monthly fee of 0% of the amount of each eligible purchase transaction or
|
||||
amount selected to create a My Chase Plan while in the 0% Intro Purchase
|
||||
APR period.
|
||||
After that, monthly fee of 1.72% of the amount of each eligible purchase
|
||||
transaction or amount selected to create a My Chase Plan. The My Chase Plan
|
||||
Fee will be determined at the time each My Chase Plan is created and will
|
||||
remain the same until the My Chase Plan is paid in full.
|
||||
d
|
||||
Transaction Fees
|
||||
Balance Transfers Intro fee of either $5 or 3% of the amount of each transfer, whichever is greater,
|
||||
on transfers made within 60 days of account opening. After that: Either $5 or 5%
|
||||
of the amount of each transfer, whichever is greater.
|
||||
Cash Advances Either $10 or 5% of the amount of each transaction, whichever is greater.
|
||||
2/25/23, 7:59 PM about:blank
|
||||
about:blank 2/4
|
||||
Foreign Transactions 3% of the amount of each transaction in U.S. dollars.
|
||||
Penalty Fees
|
||||
Late Payment Up to $40.
|
||||
Over-the-Credit-Limit None
|
||||
Return Payment Up to $40.
|
||||
Return Check None
|
||||
Note: This account may not be eligible for balance transfers.
|
||||
Loss of Intro APR: We will end your introductory APR if any required Minimum Payment is 60 days late, and
|
||||
apply the Penalty APR.
|
||||
How We Will Calculate Your Balance: We use the daily balance method (including new transactions).
|
||||
Prime Rate: Variable APRs are based on the 7.75% Prime Rate as of 2/7/2023.
|
||||
aWe add 11.74% to the Prime Rate to determine the Purchase/My Chase Loan/Balance Transfer APR.
|
||||
Maximum APR 29.99%.
|
||||
bWe add 21.74% to the Prime Rate to determine the Cash Advance APR. Maximum APR 29.99%.
|
||||
cWe add up to 26.99% to the Prime Rate to determine the Penalty APR. Maximum APR 29.99%.
|
||||
dMy Chase Plan Fee: The My Chase Plan Fee is calculated at the time each plan is created and is based on
|
||||
the amount of each purchase transaction or amount selected to create the plan, the number of billing periods
|
||||
you choose to pay the balance in full, and other factors. The monthly and aggregate dollar amount of your My
|
||||
Chase Plan Fee will be disclosed during the activation of each My Chase Plan.
|
||||
MILITARY LENDING ACT NOTICE: Federal law provides important protections to members of the Armed
|
||||
Forces and their dependents relating to extensions of consumer credit. In general, the cost of consumer credit
|
||||
to a member of the Armed Forces and his or her dependent may not exceed an annual percentage rate of 36
|
||||
percent. This rate must include, as applicable to the credit transaction or account: the costs associated with
|
||||
credit insurance premiums; fees for ancillary products sold in connection with the credit transaction; any
|
||||
application fee charged (other than certain application fees for specified credit transactions or accounts); and
|
||||
any participation fee charged (other than certain participation fees for a credit card account). To receive this
|
||||
information and a description of your payment obligation verbally, please call 1-800-235-9978.
|
||||
TERMS & CONDITIONS
|
||||
Authorization: When you respond to this credit card offer from JPMorgan Chase Bank, N.A., Member FDIC, a
|
||||
subsidiary of JPMorgan Chase & Co. ("Chase", "we", or "us"), you agree to the following:
|
||||
1. You authorize us to obtain credit bureau reports, employment, and income information about you that we
|
||||
will use when considering your application for credit. We may obtain and use information about your
|
||||
accounts with us and others such as Checking, Deposit, Investment, and Utility accounts from credit
|
||||
bureaus and other entities. You also authorize us to obtain credit bureau reports and any other
|
||||
information about you in connection with: 1) extensions of credit on your account; 2) the administration,
|
||||
review or collection of your account; and 3) offering you enhanced or additional products and services. If
|
||||
you ask, we will tell you the name and address of the credit bureau from which we obtained a report
|
||||
about you.
|
||||
2. If an account is opened, you will receive a Cardmember Agreement with your card(s). You agree to the
|
||||
terms of this agreement by: using the account or any card, authorizing their use, or making any payment
|
||||
on the account.
|
||||
3. By providing your mobile ph
|
||||
|
||||
|
||||
Given below is XML that describes the information to extract from this document and the tags to extract it into.
|
||||
|
||||
|
||||
<output>
|
||||
<list description="What fees and charges are associated with my account?" name="fees" required="true">
|
||||
<object required="true">
|
||||
<string format="lower-case; two-words" name="name" required="true"></string>
|
||||
<string format="one-line" name="explanation" required="true"></string>
|
||||
<float format="percentage" name="value" required="true"></float>
|
||||
</object>
|
||||
</list>
|
||||
<object description="What are the interest rates offered by the bank on savings and checking accounts, loans, and credit products?" name="interest_rates" required="true"></object>
|
||||
</output>
|
||||
|
||||
|
||||
ONLY return a valid JSON object (no other text is necessary). The JSON MUST conform to the XML format, including any types and format requests e.g. requests for lists, objects and specific types. Be correct and concise.
|
||||
@@ -0,0 +1,99 @@
|
||||
|
||||
I was given the following JSON response, which had problems due to incorrect values.
|
||||
|
||||
{
|
||||
"incorrect_value": {
|
||||
"fees": [
|
||||
{
|
||||
"name": "annual membership fee",
|
||||
"value": 0.0
|
||||
},
|
||||
{
|
||||
"name": "my chase plan fee",
|
||||
"value": 1.72
|
||||
},
|
||||
{
|
||||
"name": "balance transfers",
|
||||
"value": 5.0
|
||||
},
|
||||
{
|
||||
"name": "cash advances",
|
||||
"value": 5.0
|
||||
},
|
||||
{
|
||||
"name": "foreign transactions",
|
||||
"value": 3.0
|
||||
},
|
||||
{
|
||||
"name": "late payment",
|
||||
"value": 0.0
|
||||
},
|
||||
{
|
||||
"name": "over-the-credit-limit",
|
||||
"value": 0.0
|
||||
},
|
||||
{
|
||||
"name": "return payment",
|
||||
"value": 0.0
|
||||
},
|
||||
{
|
||||
"name": "return check",
|
||||
"value": 0.0
|
||||
}
|
||||
],
|
||||
"interest_rates": {
|
||||
"purchase": {
|
||||
"annual_percentage_rate": 0.0,
|
||||
"variation_explanation": "This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"balance_transfer": {
|
||||
"annual_percentage_rate": 0.0,
|
||||
"variation_explanation": "This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"cash_advance": {
|
||||
"annual_percentage_rate": 29.49,
|
||||
"variation_explanation": "This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"penalty": {
|
||||
"annual_percentage_rate": 0.0,
|
||||
"variation_explanation": "Up to 29.99%. This APR will vary with the market based on the Prime Rate.",
|
||||
"when_applies": "We may apply the Penalty APR to your account if you: fail to make a Minimum Payment by the date and time that it is due; or make a payment to us that is returned unpaid.",
|
||||
"how_long_apr_applies": "If we apply the Penalty APR for either of these reasons, the Penalty APR could potentially remain in effect indefinitely."
|
||||
}
|
||||
}
|
||||
},
|
||||
"error_messages": [
|
||||
"JSON does not match schema:\n{\n \"$.fees[0]\": [\n \"'explanation' is a required property\"\n ],\n \"$.fees[1]\": [\n \"'explanation' is a required property\"\n ],\n \"$.fees[2]\": [\n \"'explanation' is a required property\"\n ],\n \"$.fees[3]\": [\n \"'explanation' is a required property\"\n ],\n \"$.fees[4]\": [\n \"'explanation' is a required property\"\n ],\n \"$.fees[5]\": [\n \"'explanation' is a required property\"\n ],\n \"$.fees[6]\": [\n \"'explanation' is a required property\"\n ],\n \"$.fees[7]\": [\n \"'explanation' is a required property\"\n ],\n \"$.fees[8]\": [\n \"'explanation' is a required property\"\n ]\n}"
|
||||
]
|
||||
}
|
||||
|
||||
Help me correct the incorrect values based on the given error messages.
|
||||
|
||||
|
||||
Given below is XML that describes the information to extract from this document and the tags to extract it into.
|
||||
|
||||
<output>
|
||||
<list description="What fees and charges are associated with my account?" name="fees" required="true">
|
||||
<object required="true">
|
||||
<string format="lower-case; two-words" name="name" required="true"></string>
|
||||
<string format="one-line" name="explanation" required="true"></string>
|
||||
<float format="percentage" name="value" required="true"></float>
|
||||
</object>
|
||||
</list>
|
||||
<object description="What are the interest rates offered by the bank on savings and checking accounts, loans, and credit products?" name="interest_rates" required="true"></object>
|
||||
</output>
|
||||
|
||||
ONLY return a valid JSON object (no other text is necessary), where the key of the field in JSON is the `name` attribute of the corresponding XML, and the value is of the type specified by the corresponding XML's tag. The JSON MUST conform to the XML format, including any types and format requests e.g. requests for lists, objects and specific types. Be correct and concise. If you are unsure anywhere, enter `null`.
|
||||
|
||||
Here's an example of the structure:
|
||||
{
|
||||
"fees": [
|
||||
{
|
||||
"index": 1,
|
||||
"name": "annual membership",
|
||||
"explanation": "Annual Membership Fee",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"interest_rates": {}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
|
||||
Given the following document, answer the following questions. If the answer doesn't exist in the document, enter `null`.
|
||||
|
||||
2/25/23, 7:59 PM about:blank
|
||||
about:blank 1/4
|
||||
PRICING INFORMATION
|
||||
INTEREST RATES AND INTEREST CHARGES
|
||||
Purchase Annual
|
||||
Percentage Rate (APR) 0% Intro APR for the first 18 months that your Account is open.
|
||||
After that, 19.49%. This APR will vary with the market based on the Prime
|
||||
Rate.
|
||||
a
|
||||
My Chase Loan
|
||||
SM APR 19.49%. This APR will vary with the market based on the Prime Rate.
|
||||
a
|
||||
Promotional offers with fixed APRs and varying durations may be available from
|
||||
time to time on some accounts.
|
||||
Balance Transfer APR 0% Intro APR for the first 18 months that your Account is open.
|
||||
After that, 19.49%. This APR will vary with the market based on the Prime
|
||||
Rate.
|
||||
a
|
||||
Cash Advance APR 29.49%. This APR will vary with the market based on the Prime Rate.
|
||||
b
|
||||
Penalty APR and When
|
||||
It Applies
|
||||
Up to 29.99%. This APR will vary with the market based on the Prime Rate.
|
||||
c
|
||||
We may apply the Penalty APR to your account if you:
|
||||
fail to make a Minimum Payment by the date and time that it is due; or
|
||||
make a payment to us that is returned unpaid.
|
||||
How Long Will the Penalty APR Apply?: If we apply the Penalty APR for
|
||||
either of these reasons, the Penalty APR could potentially remain in effect
|
||||
indefinitely.
|
||||
How to Avoid Paying
|
||||
Interest on Purchases
|
||||
Your due date will be a minimum of 21 days after the close of each billing cycle.
|
||||
We will not charge you interest on new purchases if you pay your entire balance
|
||||
or Interest Saving Balance by the due date each month. We will begin charging
|
||||
interest on balance transfers and cash advances on the transaction date.
|
||||
Minimum Interest
|
||||
Charge
|
||||
None
|
||||
Credit Card Tips from
|
||||
the Consumer Financial
|
||||
Protection Bureau
|
||||
To learn more about factors to consider when applying for or using a credit card,
|
||||
visit the website of the Consumer Financial Protection Bureau at
|
||||
http://www.consumerfinance.gov/learnmore.
|
||||
FEES
|
||||
Annual Membership
|
||||
Fee
|
||||
None
|
||||
My Chase Plan
|
||||
SM Fee
|
||||
(fixed finance charge)
|
||||
Monthly fee of 0% of the amount of each eligible purchase transaction or
|
||||
amount selected to create a My Chase Plan while in the 0% Intro Purchase
|
||||
APR period.
|
||||
After that, monthly fee of 1.72% of the amount of each eligible purchase
|
||||
transaction or amount selected to create a My Chase Plan. The My Chase Plan
|
||||
Fee will be determined at the time each My Chase Plan is created and will
|
||||
remain the same until the My Chase Plan is paid in full.
|
||||
d
|
||||
Transaction Fees
|
||||
Balance Transfers Intro fee of either $5 or 3% of the amount of each transfer, whichever is greater,
|
||||
on transfers made within 60 days of account opening. After that: Either $5 or 5%
|
||||
of the amount of each transfer, whichever is greater.
|
||||
Cash Advances Either $10 or 5% of the amount of each transaction, whichever is greater.
|
||||
2/25/23, 7:59 PM about:blank
|
||||
about:blank 2/4
|
||||
Foreign Transactions 3% of the amount of each transaction in U.S. dollars.
|
||||
Penalty Fees
|
||||
Late Payment Up to $40.
|
||||
Over-the-Credit-Limit None
|
||||
Return Payment Up to $40.
|
||||
Return Check None
|
||||
Note: This account may not be eligible for balance transfers.
|
||||
Loss of Intro APR: We will end your introductory APR if any required Minimum Payment is 60 days late, and
|
||||
apply the Penalty APR.
|
||||
How We Will Calculate Your Balance: We use the daily balance method (including new transactions).
|
||||
Prime Rate: Variable APRs are based on the 7.75% Prime Rate as of 2/7/2023.
|
||||
aWe add 11.74% to the Prime Rate to determine the Purchase/My Chase Loan/Balance Transfer APR.
|
||||
Maximum APR 29.99%.
|
||||
bWe add 21.74% to the Prime Rate to determine the Cash Advance APR. Maximum APR 29.99%.
|
||||
cWe add up to 26.99% to the Prime Rate to determine the Penalty APR. Maximum APR 29.99%.
|
||||
dMy Chase Plan Fee: The My Chase Plan Fee is calculated at the time each plan is created and is based on
|
||||
the amount of each purchase transaction or amount selected to create the plan, the number of billing periods
|
||||
you choose to pay the balance in full, and other factors. The monthly and aggregate dollar amount of your My
|
||||
Chase Plan Fee will be disclosed during the activation of each My Chase Plan.
|
||||
MILITARY LENDING ACT NOTICE: Federal law provides important protections to members of the Armed
|
||||
Forces and their dependents relating to extensions of consumer credit. In general, the cost of consumer credit
|
||||
to a member of the Armed Forces and his or her dependent may not exceed an annual percentage rate of 36
|
||||
percent. This rate must include, as applicable to the credit transaction or account: the costs associated with
|
||||
credit insurance premiums; fees for ancillary products sold in connection with the credit transaction; any
|
||||
application fee charged (other than certain application fees for specified credit transactions or accounts); and
|
||||
any participation fee charged (other than certain participation fees for a credit card account). To receive this
|
||||
information and a description of your payment obligation verbally, please call 1-800-235-9978.
|
||||
TERMS & CONDITIONS
|
||||
Authorization: When you respond to this credit card offer from JPMorgan Chase Bank, N.A., Member FDIC, a
|
||||
subsidiary of JPMorgan Chase & Co. ("Chase", "we", or "us"), you agree to the following:
|
||||
1. You authorize us to obtain credit bureau reports, employment, and income information about you that we
|
||||
will use when considering your application for credit. We may obtain and use information about your
|
||||
accounts with us and others such as Checking, Deposit, Investment, and Utility accounts from credit
|
||||
bureaus and other entities. You also authorize us to obtain credit bureau reports and any other
|
||||
information about you in connection with: 1) extensions of credit on your account; 2) the administration,
|
||||
review or collection of your account; and 3) offering you enhanced or additional products and services. If
|
||||
you ask, we will tell you the name and address of the credit bureau from which we obtained a report
|
||||
about you.
|
||||
2. If an account is opened, you will receive a Cardmember Agreement with your card(s). You agree to the
|
||||
terms of this agreement by: using the account or any card, authorizing their use, or making any payment
|
||||
on the account.
|
||||
3. By providing your mobile ph
|
||||
|
||||
Extract information from this document and return a JSON that follows the correct schema.
|
||||
|
||||
|
||||
Given below is XML that describes the information to extract from this document and the tags to extract it into.
|
||||
|
||||
|
||||
<output>
|
||||
<list description="What fees and charges are associated with my account?" name="fees" required="true">
|
||||
<object required="true">
|
||||
<integer format="1-indexed" name="index" required="true"></integer>
|
||||
<string format="lower-case; two-words" name="name" required="true"></string>
|
||||
<string format="one-line" name="explanation" required="true"></string>
|
||||
<float format="percentage" name="value" required="true"></float>
|
||||
</object>
|
||||
</list>
|
||||
<object description="What are the interest rates offered by the bank on savings and checking accounts, loans, and credit products?" name="interest_rates" required="true"></object>
|
||||
</output>
|
||||
@@ -0,0 +1,30 @@
|
||||
<rail version="0.1">
|
||||
|
||||
<output>
|
||||
|
||||
<list name="fees" description="What fees and charges are associated with my account?">
|
||||
<object>
|
||||
<integer name="index" format="1-indexed" />
|
||||
<string name="name" validators="lower-case; two-words" on-fail-lower-case="filter"
|
||||
on-fail-two-words="filter"/>
|
||||
<string name="explanation" validators="one-line" on-fail-one-line="filter" />
|
||||
<float name="value" format="percentage"/>
|
||||
</object>
|
||||
</list>
|
||||
<object name="interest_rates" description="What are the interest rates offered by the bank on savings and checking accounts, loans, and credit products?" />
|
||||
</output>
|
||||
|
||||
<messages>
|
||||
<message role="user">
|
||||
Given the following document, answer the following questions. If the answer doesn't exist in the document, enter 'None'.
|
||||
|
||||
${document}
|
||||
|
||||
${gr.xml_prefix_prompt}
|
||||
|
||||
${xml_output_schema}
|
||||
|
||||
${gr.xml_suffix_prompt_v2_wo_none}</message>
|
||||
</messages>
|
||||
|
||||
</rail>
|
||||
@@ -0,0 +1,29 @@
|
||||
<rail version="0.1">
|
||||
|
||||
<output>
|
||||
|
||||
<list name="fees" description="What fees and charges are associated with my account?">
|
||||
<object>
|
||||
<integer name="index" format="1-indexed" />
|
||||
<string name="name" validators="lower-case; two-words" on-fail-lower-case="fix" on-fail-two-words="fix"/>
|
||||
<string name="explanation" validators="one-line" on-fail-one-line="fix" />
|
||||
<float name="value" format="percentage"/>
|
||||
</object>
|
||||
</list>
|
||||
<object name="interest_rates" description="What are the interest rates offered by the bank on savings and checking accounts, loans, and credit products?" />
|
||||
</output>
|
||||
|
||||
<messages>
|
||||
<message role="user">
|
||||
Given the following document, answer the following questions. If the answer doesn't exist in the document, enter 'None'.
|
||||
|
||||
${document}
|
||||
|
||||
${gr.xml_prefix_prompt}
|
||||
|
||||
${xml_output_schema}
|
||||
|
||||
${gr.xml_suffix_prompt_v2_wo_none}</message>
|
||||
</messages>
|
||||
|
||||
</rail>
|
||||
@@ -0,0 +1,35 @@
|
||||
<rail version="0.1">
|
||||
|
||||
<output>
|
||||
|
||||
<list name="fees" description="What fees and charges are associated with my account?">
|
||||
<object>
|
||||
<integer name="index" format="1-indexed" />
|
||||
<string name="name" validators="lower-case; two-words" on-fail-lower-case="fix" on-fail-two-words="fix"/>
|
||||
<string name="explanation" validators="one-line" on-fail-one-line="fix" />
|
||||
<float name="value" format="percentage"/>
|
||||
</object>
|
||||
</list>
|
||||
<object name="interest_rates" description="What are the interest rates offered by the bank on savings and checking accounts, loans, and credit products?" />
|
||||
</output>
|
||||
|
||||
<messages>
|
||||
<message role="system">
|
||||
You are a helpful assistant only capable of communicating with valid JSON, and no other text.
|
||||
|
||||
${gr.xml_suffix_prompt_examples}
|
||||
</message>
|
||||
<message role="user">
|
||||
Given the following document, answer the following questions. If the answer doesn't exist in the document, enter `null`.
|
||||
|
||||
${document}
|
||||
|
||||
Extract information from this document and return a JSON that follows the correct schema.
|
||||
|
||||
${gr.xml_prefix_prompt}
|
||||
|
||||
${xml_output_schema}
|
||||
</message>
|
||||
</messages>
|
||||
|
||||
</rail>
|
||||
@@ -0,0 +1,81 @@
|
||||
{
|
||||
"fees": [
|
||||
{
|
||||
"index": 1,
|
||||
"name": "annual membership",
|
||||
"explanation": "Annual Membership Fee",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"index": 2,
|
||||
"name": "my chase plan",
|
||||
"explanation": "My Chase Plan Fee (fixed finance charge)",
|
||||
"value": 1.72
|
||||
},
|
||||
{
|
||||
"index": 3,
|
||||
"name": "balance transfers",
|
||||
"explanation": "Balance Transfers Intro fee of either $5 or 3% of the amount of each transfer, whichever is greater, on transfers made within 60 days of account opening. After that: Either $5 or 5% of the amount of each transfer.",
|
||||
"value": 5
|
||||
},
|
||||
{
|
||||
"index": 4,
|
||||
"name": "cash advances",
|
||||
"explanation": "Cash Advances Either $10 or 5% of the amount of each transaction, whichever is greater.",
|
||||
"value": 5
|
||||
},
|
||||
{
|
||||
"index": 5,
|
||||
"name": "foreign transactions",
|
||||
"explanation": "Foreign Transactions 3% of the amount of each transaction in U.S. dollars.",
|
||||
"value": 3
|
||||
},
|
||||
{
|
||||
"index": 6,
|
||||
"name": "late payment",
|
||||
"explanation": "Late Payment Up to $40.",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"index": 7,
|
||||
"name": "over-the-credit-limit",
|
||||
"explanation": "Over-the-Credit-Limit None",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"index": 8,
|
||||
"name": "return payment",
|
||||
"explanation": "Return Payment Up to $40.",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"index": 9,
|
||||
"name": "return check",
|
||||
"explanation": "Return Check None",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"interest_rates": {
|
||||
"purchase": {
|
||||
"apr": 0,
|
||||
"explanation": "Purchase Annual Percentage Rate (APR) 0% Intro APR for the first 18 months that your Account is open. After that, 19.49%. This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"my_chase_loan": {
|
||||
"apr": 19.49,
|
||||
"explanation": "My Chase Loan SM APR 19.49%. This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"balance_transfer": {
|
||||
"apr": 0,
|
||||
"explanation": "Balance Transfer APR 0% Intro APR for the first 18 months that your Account is open. After that, 19.49%. This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"cash_advance": {
|
||||
"apr": 29.49,
|
||||
"explanation": "Cash Advance APR 29.49%. This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"penalty": {
|
||||
"apr": 29.99,
|
||||
"explanation": "Up to 29.99%. This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"maximum_apr": 29.99
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
{
|
||||
"fees": [
|
||||
{
|
||||
"index": 1,
|
||||
"name": "annual membership",
|
||||
"explanation": "Annual Membership Fee",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"index": 2,
|
||||
"name": "my chase",
|
||||
"explanation": "My Chase Plan Fee (fixed finance charge)",
|
||||
"value": 1.72
|
||||
},
|
||||
{
|
||||
"index": 3,
|
||||
"name": "balance transfers",
|
||||
"explanation": "Balance Transfers Intro fee of either $5 or 3% of the amount of each transfer, whichever is greater, on transfers made within 60 days of account opening. After that: Either $5 or 5% of the amount of each transfer.",
|
||||
"value": 5
|
||||
},
|
||||
{
|
||||
"index": 4,
|
||||
"name": "cash advances",
|
||||
"explanation": "Cash Advances Either $10 or 5% of the amount of each transaction, whichever is greater.",
|
||||
"value": 5
|
||||
},
|
||||
{
|
||||
"index": 5,
|
||||
"name": "foreign transactions",
|
||||
"explanation": "Foreign Transactions 3% of the amount of each transaction in U.S. dollars.",
|
||||
"value": 3
|
||||
},
|
||||
{
|
||||
"index": 6,
|
||||
"name": "late payment",
|
||||
"explanation": "Late Payment Up to $40.",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"index": 7,
|
||||
"name": "over-the-credit-limit",
|
||||
"explanation": "Over-the-Credit-Limit None",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"index": 8,
|
||||
"name": "return payment",
|
||||
"explanation": "Return Payment Up to $40.",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"index": 9,
|
||||
"name": "return check",
|
||||
"explanation": "Return Check None",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"interest_rates": {
|
||||
"purchase": {
|
||||
"apr": 0,
|
||||
"explanation": "Purchase Annual Percentage Rate (APR) 0% Intro APR for the first 18 months that your Account is open. After that, 19.49%. This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"my_chase_loan": {
|
||||
"apr": 19.49,
|
||||
"explanation": "My Chase Loan SM APR 19.49%. This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"balance_transfer": {
|
||||
"apr": 0,
|
||||
"explanation": "Balance Transfer APR 0% Intro APR for the first 18 months that your Account is open. After that, 19.49%. This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"cash_advance": {
|
||||
"apr": 29.49,
|
||||
"explanation": "Cash Advance APR 29.49%. This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"penalty": {
|
||||
"apr": 29.99,
|
||||
"explanation": "Up to 29.99%. This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"maximum_apr": 29.99
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"fees": [
|
||||
{
|
||||
"name": "my chase"
|
||||
},
|
||||
{
|
||||
"name": "over-the-credit-limit"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"fees": [
|
||||
{
|
||||
"name": "annual membership fee",
|
||||
"value": 0.0
|
||||
},
|
||||
{
|
||||
"name": "my chase plan fee",
|
||||
"value": 1.72
|
||||
},
|
||||
{
|
||||
"name": "balance transfers",
|
||||
"value": 5.0
|
||||
},
|
||||
{
|
||||
"name": "cash advances",
|
||||
"value": 5.0
|
||||
},
|
||||
{
|
||||
"name": "foreign transactions",
|
||||
"value": 3.0
|
||||
},
|
||||
{
|
||||
"name": "late payment",
|
||||
"value": 0.0
|
||||
},
|
||||
{
|
||||
"name": "over-the-credit-limit",
|
||||
"value": 0.0
|
||||
},
|
||||
{
|
||||
"name": "return payment",
|
||||
"value": 0.0
|
||||
},
|
||||
{
|
||||
"name": "return check",
|
||||
"value": 0.0
|
||||
}
|
||||
],
|
||||
"interest_rates": {
|
||||
"purchase": {
|
||||
"annual_percentage_rate": 0.0,
|
||||
"variation_explanation": "This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"balance_transfer": {
|
||||
"annual_percentage_rate": 0.0,
|
||||
"variation_explanation": "This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"cash_advance": {
|
||||
"annual_percentage_rate": 29.49,
|
||||
"variation_explanation": "This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"penalty": {
|
||||
"annual_percentage_rate": 0.0,
|
||||
"variation_explanation": "Up to 29.99%. This APR will vary with the market based on the Prime Rate.",
|
||||
"when_applies": "We may apply the Penalty APR to your account if you: fail to make a Minimum Payment by the date and time that it is due; or make a payment to us that is returned unpaid.",
|
||||
"how_long_apr_applies": "If we apply the Penalty APR for either of these reasons, the Penalty APR could potentially remain in effect indefinitely."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"fees": [
|
||||
{
|
||||
"name": "annual_membership_fee",
|
||||
"explanation": "",
|
||||
"value": 0.0
|
||||
},
|
||||
{
|
||||
"name": "my_chase_plan_fee",
|
||||
"explanation": "",
|
||||
"value": 1.72
|
||||
},
|
||||
{
|
||||
"name": "balance_transfers",
|
||||
"explanation": "",
|
||||
"value": 5.0
|
||||
},
|
||||
{
|
||||
"name": "cash_advances",
|
||||
"explanation": "",
|
||||
"value": 5.0
|
||||
},
|
||||
{
|
||||
"name": "foreign_transactions",
|
||||
"explanation": "",
|
||||
"value": 3.0
|
||||
},
|
||||
{
|
||||
"name": "late_payment",
|
||||
"explanation": "",
|
||||
"value": 0.0
|
||||
},
|
||||
{
|
||||
"name": "over-the-credit-limit",
|
||||
"explanation": "",
|
||||
"value": 0.0
|
||||
},
|
||||
{
|
||||
"name": "return_payment",
|
||||
"explanation": "",
|
||||
"value": 0.0
|
||||
},
|
||||
{
|
||||
"name": "return_check",
|
||||
"explanation": "",
|
||||
"value": 0.0
|
||||
}
|
||||
],
|
||||
"interest_rates": {
|
||||
"purchase": {
|
||||
"annual_percentage_rate": 0.0,
|
||||
"variation_explanation": "This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"balance_transfer": {
|
||||
"annual_percentage_rate": 0.0,
|
||||
"variation_explanation": "This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"cash_advance": {
|
||||
"annual_percentage_rate": 29.49,
|
||||
"variation_explanation": "This APR will vary with the market based on the Prime Rate."
|
||||
},
|
||||
"penalty": {
|
||||
"annual_percentage_rate": 29.99,
|
||||
"variation_explanation": "This APR will vary with the market based on the Prime Rate.",
|
||||
"when_applies": "We may apply the Penalty APR to your account if you: fail to make a Minimum Payment by the date and time that it is due; or make a payment to us that is returned unpaid.",
|
||||
"how_long_apr_applies": "If we apply the Penalty APR for either of these reasons, the Penalty APR could potentially remain in effect indefinitely."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
|
||||
Given the following document, answer the following questions. If the answer doesn't exist in the document, enter 'None'.
|
||||
|
||||
2/25/23, 7:59 PM about:blank
|
||||
about:blank 1/4
|
||||
PRICING INFORMATION
|
||||
INTEREST RATES AND INTEREST CHARGES
|
||||
Purchase Annual
|
||||
Percentage Rate (APR) 0% Intro APR for the first 18 months that your Account is open.
|
||||
After that, 19.49%. This APR will vary with the market based on the Prime
|
||||
Rate.
|
||||
a
|
||||
My Chase Loan
|
||||
SM APR 19.49%. This APR will vary with the market based on the Prime Rate.
|
||||
a
|
||||
Promotional offers with fixed APRs and varying durations may be available from
|
||||
time to time on some accounts.
|
||||
Balance Transfer APR 0% Intro APR for the first 18 months that your Account is open.
|
||||
After that, 19.49%. This APR will vary with the market based on the Prime
|
||||
Rate.
|
||||
a
|
||||
Cash Advance APR 29.49%. This APR will vary with the market based on the Prime Rate.
|
||||
b
|
||||
Penalty APR and When
|
||||
It Applies
|
||||
Up to 29.99%. This APR will vary with the market based on the Prime Rate.
|
||||
c
|
||||
We may apply the Penalty APR to your account if you:
|
||||
fail to make a Minimum Payment by the date and time that it is due; or
|
||||
make a payment to us that is returned unpaid.
|
||||
How Long Will the Penalty APR Apply?: If we apply the Penalty APR for
|
||||
either of these reasons, the Penalty APR could potentially remain in effect
|
||||
indefinitely.
|
||||
How to Avoid Paying
|
||||
Interest on Purchases
|
||||
Your due date will be a minimum of 21 days after the close of each billing cycle.
|
||||
We will not charge you interest on new purchases if you pay your entire balance
|
||||
or Interest Saving Balance by the due date each month. We will begin charging
|
||||
interest on balance transfers and cash advances on the transaction date.
|
||||
Minimum Interest
|
||||
Charge
|
||||
None
|
||||
Credit Card Tips from
|
||||
the Consumer Financial
|
||||
Protection Bureau
|
||||
To learn more about factors to consider when applying for or using a credit card,
|
||||
visit the website of the Consumer Financial Protection Bureau at
|
||||
http://www.consumerfinance.gov/learnmore.
|
||||
FEES
|
||||
Annual Membership
|
||||
Fee
|
||||
None
|
||||
My Chase Plan
|
||||
SM Fee
|
||||
(fixed finance charge)
|
||||
Monthly fee of 0% of the amount of each eligible purchase transaction or
|
||||
amount selected to create a My Chase Plan while in the 0% Intro Purchase
|
||||
APR period.
|
||||
After that, monthly fee of 1.72% of the amount of each eligible purchase
|
||||
transaction or amount selected to create a My Chase Plan. The My Chase Plan
|
||||
Fee will be determined at the time each My Chase Plan is created and will
|
||||
remain the same until the My Chase Plan is paid in full.
|
||||
d
|
||||
Transaction Fees
|
||||
Balance Transfers Intro fee of either $5 or 3% of the amount of each transfer, whichever is greater,
|
||||
on transfers made within 60 days of account opening. After that: Either $5 or 5%
|
||||
of the amount of each transfer, whichever is greater.
|
||||
Cash Advances Either $10 or 5% of the amount of each transaction, whichever is greater.
|
||||
2/25/23, 7:59 PM about:blank
|
||||
about:blank 2/4
|
||||
Foreign Transactions 3% of the amount of each transaction in U.S. dollars.
|
||||
Penalty Fees
|
||||
Late Payment Up to $40.
|
||||
Over-the-Credit-Limit None
|
||||
Return Payment Up to $40.
|
||||
Return Check None
|
||||
Note: This account may not be eligible for balance transfers.
|
||||
Loss of Intro APR: We will end your introductory APR if any required Minimum Payment is 60 days late, and
|
||||
apply the Penalty APR.
|
||||
How We Will Calculate Your Balance: We use the daily balance method (including new transactions).
|
||||
Prime Rate: Variable APRs are based on the 7.75% Prime Rate as of 2/7/2023.
|
||||
aWe add 11.74% to the Prime Rate to determine the Purchase/My Chase Loan/Balance Transfer APR.
|
||||
Maximum APR 29.99%.
|
||||
bWe add 21.74% to the Prime Rate to determine the Cash Advance APR. Maximum APR 29.99%.
|
||||
cWe add up to 26.99% to the Prime Rate to determine the Penalty APR. Maximum APR 29.99%.
|
||||
dMy Chase Plan Fee: The My Chase Plan Fee is calculated at the time each plan is created and is based on
|
||||
the amount of each purchase transaction or amount selected to create the plan, the number of billing periods
|
||||
you choose to pay the balance in full, and other factors. The monthly and aggregate dollar amount of your My
|
||||
Chase Plan Fee will be disclosed during the activation of each My Chase Plan.
|
||||
MILITARY LENDING ACT NOTICE: Federal law provides important protections to members of the Armed
|
||||
Forces and their dependents relating to extensions of consumer credit. In general, the cost of consumer credit
|
||||
to a member of the Armed Forces and his or her dependent may not exceed an annual percentage rate of 36
|
||||
percent. This rate must include, as applicable to the credit transaction or account: the costs associated with
|
||||
credit insurance premiums; fees for ancillary products sold in connection with the credit transaction; any
|
||||
application fee charged (other than certain application fees for specified credit transactions or accounts); and
|
||||
any participation fee charged (other than certain participation fees for a credit card account). To receive this
|
||||
information and a description of your payment obligation verbally, please call 1-800-235-9978.
|
||||
TERMS & CONDITIONS
|
||||
Authorization: When you respond to this credit card offer from JPMorgan Chase Bank, N.A., Member FDIC, a
|
||||
subsidiary of JPMorgan Chase & Co. ("Chase", "we", or "us"), you agree to the following:
|
||||
1. You authorize us to obtain credit bureau reports, employment, and income information about you that we
|
||||
will use when considering your application for credit. We may obtain and use information about your
|
||||
accounts with us and others such as Checking, Deposit, Investment, and Utility accounts from credit
|
||||
bureaus and other entities. You also authorize us to obtain credit bureau reports and any other
|
||||
information about you in connection with: 1) extensions of credit on your account; 2) the administration,
|
||||
review or collection of your account; and 3) offering you enhanced or additional products and services. If
|
||||
you ask, we will tell you the name and address of the credit bureau from which we obtained a report
|
||||
about you.
|
||||
2. If an account is opened, you will receive a Cardmember Agreement with your card(s). You agree to the
|
||||
terms of this agreement by: using the account or any card, authorizing their use, or making any payment
|
||||
on the account.
|
||||
3. By providing your mobile ph
|
||||
|
||||
|
||||
Given below is XML that describes the information to extract from this document and the tags to extract it into.
|
||||
|
||||
|
||||
<output>
|
||||
<list description="What fees and charges are associated with my account?" name="fees" required="true">
|
||||
<object required="true">
|
||||
<integer format="1-indexed" name="index" required="true"></integer>
|
||||
<string format="lower-case; two-words" name="name" required="true"></string>
|
||||
<string format="one-line" name="explanation" required="true"></string>
|
||||
<float format="percentage" name="value" required="true"></float>
|
||||
</object>
|
||||
</list>
|
||||
<object description="What are the interest rates offered by the bank on savings and checking accounts, loans, and credit products?" name="interest_rates" required="true"></object>
|
||||
</output>
|
||||
|
||||
|
||||
ONLY return a valid JSON object (no other text is necessary). The JSON MUST conform to the XML format, including any types and format requests e.g. requests for lists, objects and specific types. Be correct and concise.
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
I was given the following JSON response, which had problems due to incorrect values.
|
||||
|
||||
{
|
||||
"fees": [
|
||||
{
|
||||
"name": {
|
||||
"incorrect_value": "my chase plan",
|
||||
"error_messages": [
|
||||
"must be exactly two words"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": {
|
||||
"incorrect_value": "over-the-credit-limit",
|
||||
"error_messages": [
|
||||
"must be exactly two words"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Help me correct the incorrect values based on the given error messages.
|
||||
|
||||
Given below is XML that describes the information to extract from this document and the tags to extract it into.
|
||||
|
||||
<output>
|
||||
<list description="What fees and charges are associated with my account?" name="fees" required="true">
|
||||
<object required="true">
|
||||
<integer format="1-indexed" name="index" required="true"></integer>
|
||||
<string format="lower-case; two-words" name="name" required="true"></string>
|
||||
<string format="one-line" name="explanation" required="true"></string>
|
||||
<float format="percentage" name="value" required="true"></float>
|
||||
</object>
|
||||
</list>
|
||||
<object description="What are the interest rates offered by the bank on savings and checking accounts, loans, and credit products?" name="interest_rates" required="true"></object>
|
||||
</output>
|
||||
|
||||
ONLY return a valid JSON object (no other text is necessary), where the key of the field in JSON is the `name` attribute of the corresponding XML, and the value is of the type specified by the corresponding XML's tag. The JSON MUST conform to the XML format, including any types and format requests e.g. requests for lists, objects and specific types. Be correct and concise. If you are unsure anywhere, enter `null`.
|
||||
@@ -0,0 +1,29 @@
|
||||
<rail version="0.1">
|
||||
|
||||
<output>
|
||||
|
||||
<list name="fees" description="What fees and charges are associated with my account?">
|
||||
<object>
|
||||
<integer name="index" format="1-indexed" />
|
||||
<string name="name" validators="lower-case; two-words" on-fail-lower-case="noop" on-fail-two-words="noop"/>
|
||||
<string name="explanation" validators="one-line" on-fail-one-line="noop" />
|
||||
<float name="value" format="percentage"/>
|
||||
</object>
|
||||
</list>
|
||||
<object name="interest_rates" description="What are the interest rates offered by the bank on savings and checking accounts, loans, and credit products?" />
|
||||
</output>
|
||||
|
||||
<messages>
|
||||
<message role="user">
|
||||
Given the following document, answer the following questions. If the answer doesn't exist in the document, enter 'None'.
|
||||
|
||||
${document}
|
||||
|
||||
${gr.xml_prefix_prompt}
|
||||
|
||||
${xml_output_schema}
|
||||
|
||||
${gr.xml_suffix_prompt_v2_wo_none}</message>
|
||||
</messages>
|
||||
|
||||
</rail>
|
||||
@@ -0,0 +1,42 @@
|
||||
# ruff: noqa: E501
|
||||
|
||||
OPTIONAL_PROMPT_COMPLETION_MODEL = """
|
||||
Given the following document, answer the following questions. If the answer doesn't exist in the document, enter 'None'.
|
||||
|
||||
${document}
|
||||
|
||||
${gr.xml_prefix_prompt}
|
||||
|
||||
${xml_output_schema}
|
||||
|
||||
${gr.xml_suffix_prompt_v2_wo_none}"""
|
||||
|
||||
|
||||
OPTIONAL_PROMPT_CHAT_MODEL = """
|
||||
Given the following document, answer the following questions. If the answer doesn't exist in the document, enter `null`.
|
||||
|
||||
${document}
|
||||
|
||||
Extract information from this document and return a JSON that follows the correct schema.
|
||||
|
||||
${gr.xml_prefix_prompt}
|
||||
|
||||
${xml_output_schema}
|
||||
"""
|
||||
OPTIONAL_INSTRUCTIONS_CHAT_MODEL = """
|
||||
You are a helpful assistant only capable of communicating with valid JSON, and no other text.
|
||||
|
||||
${gr.xml_suffix_prompt_examples}
|
||||
"""
|
||||
|
||||
|
||||
OPTIONAL_MSG_HISTORY = [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "\nYou are a helpful assistant only capable of communicating with valid JSON, and no other text.\n\n${gr.xml_suffix_prompt_examples}\n",
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "\nGiven the following document, answer the following questions. If the answer doesn't exist in the document, enter `null`.\n\n${document}\n\nExtract information from this document and return a JSON that follows the correct schema.\n\n${gr.xml_prefix_prompt}\n\n${xml_output_schema}\n",
|
||||
},
|
||||
]
|
||||
@@ -0,0 +1,148 @@
|
||||
from typing import Dict, List
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from guardrails.validator_base import OnFailAction
|
||||
from tests.integration_tests.test_assets.validators import LowerCase, OneLine, TwoWords
|
||||
|
||||
|
||||
class FeeDetailsFilter(BaseModel):
|
||||
index: int = Field(format="1-indexed")
|
||||
name: str = Field(
|
||||
validators=[
|
||||
LowerCase(on_fail=OnFailAction.FILTER),
|
||||
TwoWords(on_fail=OnFailAction.FILTER),
|
||||
]
|
||||
)
|
||||
explanation: str = Field(validators=OneLine(on_fail=OnFailAction.FILTER))
|
||||
value: float = Field(format="percentage")
|
||||
|
||||
|
||||
class ContractDetailsFilter(BaseModel):
|
||||
fees: List[FeeDetailsFilter] = Field(
|
||||
description="What fees and charges are associated with my account?"
|
||||
)
|
||||
interest_rates: Dict = Field(
|
||||
description="What are the interest rates offered by the bank on savings "
|
||||
"and checking accounts, loans, and credit products?"
|
||||
)
|
||||
|
||||
|
||||
class FeeDetailsFix(BaseModel):
|
||||
index: int = Field(format="1-indexed")
|
||||
name: str = Field(
|
||||
validators=[
|
||||
LowerCase(on_fail=OnFailAction.FIX),
|
||||
TwoWords(on_fail=OnFailAction.FIX),
|
||||
]
|
||||
)
|
||||
explanation: str = Field(validators=OneLine(on_fail=OnFailAction.FIX))
|
||||
value: float = Field(format="percentage")
|
||||
|
||||
|
||||
class ContractDetailsFix(BaseModel):
|
||||
fees: List[FeeDetailsFix] = Field(
|
||||
description="What fees and charges are associated with my account?"
|
||||
)
|
||||
interest_rates: Dict = Field(
|
||||
description="What are the interest rates offered by the bank on savings "
|
||||
"and checking accounts, loans, and credit products?"
|
||||
)
|
||||
|
||||
|
||||
class FeeDetailsNoop(BaseModel):
|
||||
index: int = Field(format="1-indexed")
|
||||
name: str = Field(
|
||||
validators=[
|
||||
LowerCase(on_fail=OnFailAction.NOOP),
|
||||
TwoWords(on_fail=OnFailAction.NOOP),
|
||||
]
|
||||
)
|
||||
explanation: str = Field(validators=OneLine(on_fail=OnFailAction.NOOP))
|
||||
value: float = Field(format="percentage")
|
||||
|
||||
|
||||
class ContractDetailsNoop(BaseModel):
|
||||
fees: List[FeeDetailsNoop] = Field(
|
||||
description="What fees and charges are associated with my account?"
|
||||
)
|
||||
interest_rates: Dict = Field(
|
||||
description="What are the interest rates offered by the bank on savings "
|
||||
"and checking accounts, loans, and credit products?"
|
||||
)
|
||||
|
||||
|
||||
class FeeDetailsReask(BaseModel):
|
||||
index: int = Field(format="1-indexed")
|
||||
name: str = Field(
|
||||
validators=[
|
||||
LowerCase(on_fail=OnFailAction.NOOP),
|
||||
TwoWords(on_fail=OnFailAction.REASK),
|
||||
]
|
||||
)
|
||||
explanation: str = Field(validators=OneLine(on_fail=OnFailAction.NOOP))
|
||||
value: float = Field(format="percentage")
|
||||
|
||||
|
||||
class ContractDetailsReask(BaseModel):
|
||||
fees: List[FeeDetailsReask] = Field(
|
||||
description="What fees and charges are associated with my account?"
|
||||
)
|
||||
interest_rates: Dict = Field(
|
||||
description="What are the interest rates offered by the bank on savings "
|
||||
"and checking accounts, loans, and credit products?"
|
||||
)
|
||||
|
||||
|
||||
class FeeDetailsRefrain(BaseModel):
|
||||
index: int = Field(format="1-indexed")
|
||||
name: str = Field(
|
||||
validators=[
|
||||
LowerCase(on_fail=OnFailAction.REFRAIN),
|
||||
TwoWords(on_fail=OnFailAction.REFRAIN),
|
||||
]
|
||||
)
|
||||
explanation: str = Field(validators=OneLine(on_fail=OnFailAction.REFRAIN))
|
||||
value: float = Field(format="percentage")
|
||||
|
||||
|
||||
class ContractDetailsRefrain(BaseModel):
|
||||
fees: List[FeeDetailsRefrain] = Field(
|
||||
description="What fees and charges are associated with my account?"
|
||||
)
|
||||
interest_rates: Dict = Field(
|
||||
description="What are the interest rates offered by the bank on savings "
|
||||
"and checking accounts, loans, and credit products?"
|
||||
)
|
||||
|
||||
|
||||
PROMPT = """
|
||||
Given the following document, answer the following questions. If the answer doesn't exist in the document, enter 'None'.
|
||||
|
||||
${document}
|
||||
|
||||
${gr.xml_prefix_prompt}
|
||||
|
||||
${xml_output_schema}
|
||||
|
||||
${gr.xml_suffix_prompt_v2_wo_none}""" # noqa: E501
|
||||
|
||||
|
||||
INSTRUCTIONS_CHAT_MODEL = """
|
||||
You are a helpful assistant only capable of communicating with valid JSON, and no other text.
|
||||
|
||||
${gr.xml_suffix_prompt_examples}
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
PROMPT_CHAT_MODEL = """
|
||||
Given the following document, answer the following questions. If the answer doesn't exist in the document, enter `null`.
|
||||
|
||||
${document}
|
||||
|
||||
Extract information from this document and return a JSON that follows the correct schema.
|
||||
|
||||
${gr.xml_prefix_prompt}
|
||||
|
||||
${xml_output_schema}
|
||||
""" # noqa: E501
|
||||
@@ -0,0 +1,31 @@
|
||||
<rail version="0.1">
|
||||
|
||||
<output>
|
||||
|
||||
<list name="fees" description="What fees and charges are associated with my account?">
|
||||
<object>
|
||||
<integer name="index" format="1-indexed" />
|
||||
<string name="name" validators="lower-case; two-words" on-fail-lower-case="noop"
|
||||
on-fail-two-words="reask"/>
|
||||
<string name="explanation" validators="one-line" on-fail-one-line="noop" />
|
||||
<float name="value" format="percentage"/>
|
||||
</object>
|
||||
</list>
|
||||
<object name="interest_rates" description="What are the interest rates offered by the bank on savings and checking accounts, loans, and credit products?" />
|
||||
</output>
|
||||
|
||||
|
||||
<messages>
|
||||
<message role="user">
|
||||
Given the following document, answer the following questions. If the answer doesn't exist in the document, enter 'None'.
|
||||
|
||||
${document}
|
||||
|
||||
${gr.xml_prefix_prompt}
|
||||
|
||||
${xml_output_schema}
|
||||
|
||||
${gr.xml_suffix_prompt_v2_wo_none}</message>
|
||||
</messages>
|
||||
|
||||
</rail>
|
||||
@@ -0,0 +1,17 @@
|
||||
<rail version="0.1">
|
||||
|
||||
<output>
|
||||
|
||||
<list name="fees" description="What fees and charges are associated with my account?">
|
||||
<object>
|
||||
<integer name="index" format="1-indexed" />
|
||||
<string name="name" validators="lower-case; two-words" on-fail-lower-case="noop"
|
||||
on-fail-two-words="reask"/>
|
||||
<string name="explanation" validators="one-line" on-fail-one-line="noop" />
|
||||
<float name="value" format="percentage"/>
|
||||
</object>
|
||||
</list>
|
||||
<object name="interest_rates" description="What are the interest rates offered by the bank on savings and checking accounts, loans, and credit products?" />
|
||||
</output>
|
||||
|
||||
</rail>
|
||||
@@ -0,0 +1,29 @@
|
||||
<rail version="0.1">
|
||||
|
||||
<output>
|
||||
|
||||
<list name="fees" description="What fees and charges are associated with my account?">
|
||||
<object>
|
||||
<integer name="index" format="1-indexed" />
|
||||
<string name="name" validators="lower-case; two-words" on-fail-lower-case="refrain" on-fail-two-words="refrain"/>
|
||||
<string name="explanation" validators="one-line" on-fail-one-line="refrain" />
|
||||
<float name="value" format="percentage"/>
|
||||
</object>
|
||||
</list>
|
||||
<object name="interest_rates" description="What are the interest rates offered by the bank on savings and checking accounts, loans, and credit products?" />
|
||||
</output>
|
||||
|
||||
|
||||
<messages>
|
||||
<message role="user">
|
||||
Given the following document, answer the following questions. If the answer doesn't exist in the document, enter 'None'.
|
||||
|
||||
${document}
|
||||
|
||||
${gr.xml_prefix_prompt}
|
||||
|
||||
${xml_output_schema}
|
||||
|
||||
${gr.xml_suffix_prompt_v2_wo_none}</message>
|
||||
</messages>
|
||||
</rail>
|
||||
@@ -0,0 +1,28 @@
|
||||
<rail version="0.1">
|
||||
<output>
|
||||
|
||||
<list name="fees" description="What fees and charges are associated with my account?">
|
||||
<object>
|
||||
<string name="name" validators="lower-case; two-words" on-fail-lower-case="noop" on-fail-two-words="reask"/>
|
||||
<string name="explanation" validators="one-line" on-fail-one-line="noop" />
|
||||
<float name="value" format="percentage"/>
|
||||
</object>
|
||||
</list>
|
||||
<object name="interest_rates" description="What are the interest rates offered by the bank on savings and checking accounts, loans, and credit products?" />
|
||||
</output>
|
||||
|
||||
<messages>
|
||||
<message role="user">
|
||||
Given the following document, answer the following questions. If the answer doesn't exist in the document, enter
|
||||
'None'.
|
||||
|
||||
${document}
|
||||
|
||||
${gr.xml_prefix_prompt}
|
||||
|
||||
${xml_output_schema}
|
||||
|
||||
${gr.xml_suffix_prompt_v2_wo_none}</message>
|
||||
</messages>
|
||||
|
||||
</rail>
|
||||
@@ -0,0 +1,76 @@
|
||||
# ruff: noqa: E501
|
||||
VALIDATED_OUTPUT_FILTER = {
|
||||
"fees": [
|
||||
{
|
||||
"index": 1,
|
||||
"name": "annual membership",
|
||||
"explanation": "Annual Membership Fee",
|
||||
"value": 0,
|
||||
},
|
||||
{
|
||||
"index": 2,
|
||||
"explanation": "My Chase Plan Fee (fixed finance charge)",
|
||||
"value": 1.72,
|
||||
},
|
||||
{
|
||||
"index": 3,
|
||||
"name": "balance transfers",
|
||||
"explanation": "Balance Transfers Intro fee of either $5 or 3% of the amount of each transfer, whichever is greater, on transfers made within 60 days of account opening. After that: Either $5 or 5% of the amount of each transfer.",
|
||||
"value": 5,
|
||||
},
|
||||
{
|
||||
"index": 4,
|
||||
"name": "cash advances",
|
||||
"explanation": "Cash Advances Either $10 or 5% of the amount of each transaction, whichever is greater.",
|
||||
"value": 5,
|
||||
},
|
||||
{
|
||||
"index": 5,
|
||||
"name": "foreign transactions",
|
||||
"explanation": "Foreign Transactions 3% of the amount of each transaction in U.S. dollars.",
|
||||
"value": 3,
|
||||
},
|
||||
{
|
||||
"index": 6,
|
||||
"name": "late payment",
|
||||
"explanation": "Late Payment Up to $40.",
|
||||
"value": 0,
|
||||
},
|
||||
{"index": 7, "explanation": "Over-the-Credit-Limit None", "value": 0},
|
||||
{
|
||||
"index": 8,
|
||||
"name": "return payment",
|
||||
"explanation": "Return Payment Up to $40.",
|
||||
"value": 0,
|
||||
},
|
||||
{
|
||||
"index": 9,
|
||||
"name": "return check",
|
||||
"explanation": "Return Check None",
|
||||
"value": 0,
|
||||
},
|
||||
],
|
||||
"interest_rates": {
|
||||
"purchase": {
|
||||
"apr": 0,
|
||||
"explanation": "Purchase Annual Percentage Rate (APR) 0% Intro APR for the first 18 months that your Account is open. After that, 19.49%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"my_chase_loan": {
|
||||
"apr": 19.49,
|
||||
"explanation": "My Chase Loan SM APR 19.49%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"balance_transfer": {
|
||||
"apr": 0,
|
||||
"explanation": "Balance Transfer APR 0% Intro APR for the first 18 months that your Account is open. After that, 19.49%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"cash_advance": {
|
||||
"apr": 29.49,
|
||||
"explanation": "Cash Advance APR 29.49%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"penalty": {
|
||||
"apr": 29.99,
|
||||
"explanation": "Up to 29.99%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"maximum_apr": 29.99,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
# ruff: noqa: E501
|
||||
VALIDATED_OUTPUT_FIX = {
|
||||
"fees": [
|
||||
{
|
||||
"index": 1,
|
||||
"name": "annual membership",
|
||||
"explanation": "Annual Membership Fee",
|
||||
"value": 0,
|
||||
},
|
||||
{
|
||||
"index": 2,
|
||||
"name": "my chase",
|
||||
"explanation": "My Chase Plan Fee (fixed finance charge)",
|
||||
"value": 1.72,
|
||||
},
|
||||
{
|
||||
"index": 3,
|
||||
"name": "balance transfers",
|
||||
"explanation": "Balance Transfers Intro fee of either $5 or 3% of the amount of each transfer, whichever is greater, on transfers made within 60 days of account opening. After that: Either $5 or 5% of the amount of each transfer.",
|
||||
"value": 5,
|
||||
},
|
||||
{
|
||||
"index": 4,
|
||||
"name": "cash advances",
|
||||
"explanation": "Cash Advances Either $10 or 5% of the amount of each transaction, whichever is greater.",
|
||||
"value": 5,
|
||||
},
|
||||
{
|
||||
"index": 5,
|
||||
"name": "foreign transactions",
|
||||
"explanation": "Foreign Transactions 3% of the amount of each transaction in U.S. dollars.",
|
||||
"value": 3,
|
||||
},
|
||||
{
|
||||
"index": 6,
|
||||
"name": "late payment",
|
||||
"explanation": "Late Payment Up to $40.",
|
||||
"value": 0,
|
||||
},
|
||||
{
|
||||
"index": 7,
|
||||
"name": "over the",
|
||||
"explanation": "Over-the-Credit-Limit None",
|
||||
"value": 0,
|
||||
},
|
||||
{
|
||||
"index": 8,
|
||||
"name": "return payment",
|
||||
"explanation": "Return Payment Up to $40.",
|
||||
"value": 0,
|
||||
},
|
||||
{
|
||||
"index": 9,
|
||||
"name": "return check",
|
||||
"explanation": "Return Check None",
|
||||
"value": 0,
|
||||
},
|
||||
],
|
||||
"interest_rates": {
|
||||
"purchase": {
|
||||
"apr": 0,
|
||||
"explanation": "Purchase Annual Percentage Rate (APR) 0% Intro APR for the first 18 months that your Account is open. After that, 19.49%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"my_chase_loan": {
|
||||
"apr": 19.49,
|
||||
"explanation": "My Chase Loan SM APR 19.49%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"balance_transfer": {
|
||||
"apr": 0,
|
||||
"explanation": "Balance Transfer APR 0% Intro APR for the first 18 months that your Account is open. After that, 19.49%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"cash_advance": {
|
||||
"apr": 29.49,
|
||||
"explanation": "Cash Advance APR 29.49%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"penalty": {
|
||||
"apr": 29.99,
|
||||
"explanation": "Up to 29.99%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"maximum_apr": 29.99,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
# ruff: noqa: E501
|
||||
VALIDATED_OUTPUT_NOOP = {
|
||||
"fees": [
|
||||
{
|
||||
"index": 1,
|
||||
"name": "annual membership",
|
||||
"explanation": "Annual Membership Fee",
|
||||
"value": 0,
|
||||
},
|
||||
{
|
||||
"index": 2,
|
||||
"name": "my chase plan",
|
||||
"explanation": "My Chase Plan Fee (fixed finance charge)",
|
||||
"value": 1.72,
|
||||
},
|
||||
{
|
||||
"index": 3,
|
||||
"name": "balance transfers",
|
||||
"explanation": "Balance Transfers Intro fee of either $5 or 3% of the amount of each transfer, whichever is greater, on transfers made within 60 days of account opening. After that: Either $5 or 5% of the amount of each transfer.",
|
||||
"value": 5,
|
||||
},
|
||||
{
|
||||
"index": 4,
|
||||
"name": "cash advances",
|
||||
"explanation": "Cash Advances Either $10 or 5% of the amount of each transaction, whichever is greater.",
|
||||
"value": 5,
|
||||
},
|
||||
{
|
||||
"index": 5,
|
||||
"name": "foreign transactions",
|
||||
"explanation": "Foreign Transactions 3% of the amount of each transaction in U.S. dollars.",
|
||||
"value": 3,
|
||||
},
|
||||
{
|
||||
"index": 6,
|
||||
"name": "late payment",
|
||||
"explanation": "Late Payment Up to $40.",
|
||||
"value": 0,
|
||||
},
|
||||
{
|
||||
"index": 7,
|
||||
"name": "over-the-credit-limit",
|
||||
"explanation": "Over-the-Credit-Limit None",
|
||||
"value": 0,
|
||||
},
|
||||
{
|
||||
"index": 8,
|
||||
"name": "return payment",
|
||||
"explanation": "Return Payment Up to $40.",
|
||||
"value": 0,
|
||||
},
|
||||
{
|
||||
"index": 9,
|
||||
"name": "return check",
|
||||
"explanation": "Return Check None",
|
||||
"value": 0,
|
||||
},
|
||||
],
|
||||
"interest_rates": {
|
||||
"purchase": {
|
||||
"apr": 0,
|
||||
"explanation": "Purchase Annual Percentage Rate (APR) 0% Intro APR for the first 18 months that your Account is open. After that, 19.49%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"my_chase_loan": {
|
||||
"apr": 19.49,
|
||||
"explanation": "My Chase Loan SM APR 19.49%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"balance_transfer": {
|
||||
"apr": 0,
|
||||
"explanation": "Balance Transfer APR 0% Intro APR for the first 18 months that your Account is open. After that, 19.49%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"cash_advance": {
|
||||
"apr": 29.49,
|
||||
"explanation": "Cash Advance APR 29.49%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"penalty": {
|
||||
"apr": 29.99,
|
||||
"explanation": "Up to 29.99%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"maximum_apr": 29.99,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
# ruff: noqa: E501
|
||||
from guardrails.actions.reask import FieldReAsk
|
||||
from guardrails_ai.types import FailResult
|
||||
|
||||
VALIDATED_OUTPUT_REASK_1 = {
|
||||
"fees": [
|
||||
{
|
||||
"index": 1,
|
||||
"name": "annual membership",
|
||||
"explanation": "Annual Membership Fee",
|
||||
"value": 0,
|
||||
},
|
||||
{
|
||||
"index": 2,
|
||||
"name": FieldReAsk(
|
||||
incorrect_value="my chase plan",
|
||||
fail_results=[
|
||||
FailResult(
|
||||
error_message="must be exactly two words",
|
||||
fix_value="my chase",
|
||||
)
|
||||
],
|
||||
path=["fees", 1, "name"],
|
||||
),
|
||||
"explanation": "My Chase Plan Fee (fixed finance charge)",
|
||||
"value": 1.72,
|
||||
},
|
||||
{
|
||||
"index": 3,
|
||||
"name": "balance transfers",
|
||||
"explanation": "Balance Transfers Intro fee of either $5 or 3% of the amount of each transfer, whichever is greater, on transfers made within 60 days of account opening. After that: Either $5 or 5% of the amount of each transfer.",
|
||||
"value": 5,
|
||||
},
|
||||
{
|
||||
"index": 4,
|
||||
"name": "cash advances",
|
||||
"explanation": "Cash Advances Either $10 or 5% of the amount of each transaction, whichever is greater.",
|
||||
"value": 5,
|
||||
},
|
||||
{
|
||||
"index": 5,
|
||||
"name": "foreign transactions",
|
||||
"explanation": "Foreign Transactions 3% of the amount of each transaction in U.S. dollars.",
|
||||
"value": 3,
|
||||
},
|
||||
{
|
||||
"index": 6,
|
||||
"name": "late payment",
|
||||
"explanation": "Late Payment Up to $40.",
|
||||
"value": 0,
|
||||
},
|
||||
{
|
||||
"index": 7,
|
||||
"name": FieldReAsk(
|
||||
incorrect_value="over-the-credit-limit",
|
||||
fail_results=[
|
||||
FailResult(
|
||||
error_message="must be exactly two words",
|
||||
fix_value="over the",
|
||||
)
|
||||
],
|
||||
path=["fees", 6, "name"],
|
||||
),
|
||||
"explanation": "Over-the-Credit-Limit None",
|
||||
"value": 0,
|
||||
},
|
||||
{
|
||||
"index": 8,
|
||||
"name": "return payment",
|
||||
"explanation": "Return Payment Up to $40.",
|
||||
"value": 0,
|
||||
},
|
||||
{
|
||||
"index": 9,
|
||||
"name": "return check",
|
||||
"explanation": "Return Check None",
|
||||
"value": 0,
|
||||
},
|
||||
],
|
||||
"interest_rates": {
|
||||
"purchase": {
|
||||
"apr": 0,
|
||||
"explanation": "Purchase Annual Percentage Rate (APR) 0% Intro APR for the first 18 months that your Account is open. After that, 19.49%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"my_chase_loan": {
|
||||
"apr": 19.49,
|
||||
"explanation": "My Chase Loan SM APR 19.49%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"balance_transfer": {
|
||||
"apr": 0,
|
||||
"explanation": "Balance Transfer APR 0% Intro APR for the first 18 months that your Account is open. After that, 19.49%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"cash_advance": {
|
||||
"apr": 29.49,
|
||||
"explanation": "Cash Advance APR 29.49%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"penalty": {
|
||||
"apr": 29.99,
|
||||
"explanation": "Up to 29.99%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"maximum_apr": 29.99,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
# ruff: noqa: E501
|
||||
VALIDATED_OUTPUT_REASK_2 = {
|
||||
"fees": [
|
||||
{
|
||||
"index": 1,
|
||||
"name": "annual membership",
|
||||
"explanation": "Annual Membership Fee",
|
||||
"value": 0,
|
||||
},
|
||||
{
|
||||
"index": 2,
|
||||
"name": "my chase",
|
||||
"explanation": "My Chase Plan Fee (fixed finance charge)",
|
||||
"value": 1.72,
|
||||
},
|
||||
{
|
||||
"index": 3,
|
||||
"name": "balance transfers",
|
||||
"explanation": "Balance Transfers Intro fee of either $5 or 3% of the amount of each transfer, whichever is greater, on transfers made within 60 days of account opening. After that: Either $5 or 5% of the amount of each transfer.",
|
||||
"value": 5,
|
||||
},
|
||||
{
|
||||
"index": 4,
|
||||
"name": "cash advances",
|
||||
"explanation": "Cash Advances Either $10 or 5% of the amount of each transaction, whichever is greater.",
|
||||
"value": 5,
|
||||
},
|
||||
{
|
||||
"index": 5,
|
||||
"name": "foreign transactions",
|
||||
"explanation": "Foreign Transactions 3% of the amount of each transaction in U.S. dollars.",
|
||||
"value": 3,
|
||||
},
|
||||
{
|
||||
"index": 6,
|
||||
"name": "late payment",
|
||||
"explanation": "Late Payment Up to $40.",
|
||||
"value": 0,
|
||||
},
|
||||
{
|
||||
"index": 7,
|
||||
"name": "over the",
|
||||
"explanation": "Over-the-Credit-Limit None",
|
||||
"value": 0,
|
||||
},
|
||||
{
|
||||
"index": 8,
|
||||
"name": "return payment",
|
||||
"explanation": "Return Payment Up to $40.",
|
||||
"value": 0,
|
||||
},
|
||||
{
|
||||
"index": 9,
|
||||
"name": "return check",
|
||||
"explanation": "Return Check None",
|
||||
"value": 0,
|
||||
},
|
||||
],
|
||||
"interest_rates": {
|
||||
"purchase": {
|
||||
"apr": 0,
|
||||
"explanation": "Purchase Annual Percentage Rate (APR) 0% Intro APR for the first 18 months that your Account is open. After that, 19.49%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"my_chase_loan": {
|
||||
"apr": 19.49,
|
||||
"explanation": "My Chase Loan SM APR 19.49%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"balance_transfer": {
|
||||
"apr": 0,
|
||||
"explanation": "Balance Transfer APR 0% Intro APR for the first 18 months that your Account is open. After that, 19.49%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"cash_advance": {
|
||||
"apr": 29.49,
|
||||
"explanation": "Cash Advance APR 29.49%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"penalty": {
|
||||
"apr": 29.99,
|
||||
"explanation": "Up to 29.99%. This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"maximum_apr": 29.99,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
VALIDATED_OUTPUT_REFRAIN = None
|
||||
@@ -0,0 +1,47 @@
|
||||
# ruff: noqa: E501
|
||||
from guardrails.actions.reask import SkeletonReAsk
|
||||
from guardrails_ai.types import FailResult
|
||||
|
||||
VALIDATED_OUTPUT_SKELETON_REASK_1 = SkeletonReAsk(
|
||||
incorrect_value={
|
||||
"fees": [
|
||||
{"name": "annual membership fee", "value": 0.0},
|
||||
{"name": "my chase plan fee", "value": 1.72},
|
||||
{"name": "balance transfers", "value": 5.0},
|
||||
{"name": "cash advances", "value": 5.0},
|
||||
{"name": "foreign transactions", "value": 3.0},
|
||||
{"name": "late payment", "value": 0.0},
|
||||
{"name": "over-the-credit-limit", "value": 0.0},
|
||||
{"name": "return payment", "value": 0.0},
|
||||
{"name": "return check", "value": 0.0},
|
||||
],
|
||||
"interest_rates": {
|
||||
"purchase": {
|
||||
"annual_percentage_rate": 0.0,
|
||||
"variation_explanation": "This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"balance_transfer": {
|
||||
"annual_percentage_rate": 0.0,
|
||||
"variation_explanation": "This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"cash_advance": {
|
||||
"annual_percentage_rate": 29.49,
|
||||
"variation_explanation": "This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"penalty": {
|
||||
"annual_percentage_rate": 0.0,
|
||||
"variation_explanation": "Up to 29.99%. This APR will vary with the market based on the Prime Rate.",
|
||||
"when_applies": "We may apply the Penalty APR to your account if you: fail to make a Minimum Payment by the date and time that it is due; or make a payment to us that is returned unpaid.",
|
||||
"how_long_apr_applies": "If we apply the Penalty APR for either of these reasons, the Penalty APR could potentially remain in effect indefinitely.",
|
||||
},
|
||||
},
|
||||
},
|
||||
fail_results=[
|
||||
FailResult(
|
||||
outcome="fail",
|
||||
error_message='JSON does not match schema:\n{\n "$.fees[0]": [\n "\'explanation\' is a required property"\n ],\n "$.fees[1]": [\n "\'explanation\' is a required property"\n ],\n "$.fees[2]": [\n "\'explanation\' is a required property"\n ],\n "$.fees[3]": [\n "\'explanation\' is a required property"\n ],\n "$.fees[4]": [\n "\'explanation\' is a required property"\n ],\n "$.fees[5]": [\n "\'explanation\' is a required property"\n ],\n "$.fees[6]": [\n "\'explanation\' is a required property"\n ],\n "$.fees[7]": [\n "\'explanation\' is a required property"\n ],\n "$.fees[8]": [\n "\'explanation\' is a required property"\n ]\n}',
|
||||
fix_value=None,
|
||||
metadata=None,
|
||||
)
|
||||
],
|
||||
)
|
||||
@@ -0,0 +1,34 @@
|
||||
# ruff: noqa: E501
|
||||
VALIDATED_OUTPUT_SKELETON_REASK_2 = {
|
||||
"fees": [
|
||||
{"name": "annual membership", "explanation": "", "value": 0.0},
|
||||
{"name": "my chase", "explanation": "", "value": 1.72},
|
||||
{"name": "balance transfers", "explanation": "", "value": 5.0},
|
||||
{"name": "cash advances", "explanation": "", "value": 5.0},
|
||||
{"name": "foreign transactions", "explanation": "", "value": 3.0},
|
||||
{"name": "late payment", "explanation": "", "value": 0.0},
|
||||
{"name": "over the", "explanation": "", "value": 0.0},
|
||||
{"name": "return payment", "explanation": "", "value": 0.0},
|
||||
{"name": "return check", "explanation": "", "value": 0.0},
|
||||
],
|
||||
"interest_rates": {
|
||||
"purchase": {
|
||||
"annual_percentage_rate": 0.0,
|
||||
"variation_explanation": "This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"balance_transfer": {
|
||||
"annual_percentage_rate": 0.0,
|
||||
"variation_explanation": "This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"cash_advance": {
|
||||
"annual_percentage_rate": 29.49,
|
||||
"variation_explanation": "This APR will vary with the market based on the Prime Rate.",
|
||||
},
|
||||
"penalty": {
|
||||
"annual_percentage_rate": 29.99,
|
||||
"variation_explanation": "This APR will vary with the market based on the Prime Rate.",
|
||||
"when_applies": "We may apply the Penalty APR to your account if you: fail to make a Minimum Payment by the date and time that it is due; or make a payment to us that is returned unpaid.",
|
||||
"how_long_apr_applies": "If we apply the Penalty APR for either of these reasons, the Penalty APR could potentially remain in effect indefinitely.",
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user