Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions frontend/src/shared/templates/chip_negotiation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const CHIP_TOS_STAGE = createTOSStage({
'Your participation is voluntary, which means you can choose whether or not to participate. You may choose not to participate by exiting the survey at any point. There are no known costs to you for participating in this research study except for your time.',
'\n**Contact**',
'Please feel free to contact us through Prolific or your game administrator if you have any questions, concerns, or complaints about this study.',
'\nBy checking the box below and proceeding, you are acknowledging that you are over the age of 18 and that you consent to participate. Clicking the arrow will bring you to the beginning of the task.',
'\nBy checking the box below and proceeding, you are acknowledging that you are over the age of 18 and that you consent to participate. "NEXT STEP" will bring you to the beginning of the task.',
],
progress: createStageProgressConfig({
showParticipantProgress: false,
Expand Down Expand Up @@ -226,7 +226,7 @@ function createChipInfoStage1(numChips: number) {

function createChipInfoStage2(numChips: number) {
const infoLines = [
'You will play this trading game three times against different groups of participants. In each game, you and the other participants will start with:',
'You will play this trading game three times. In each game, you and the other participants will start with:',
];

// Adjust the chips included based on numChips
Expand Down Expand Up @@ -287,10 +287,6 @@ function createChipInfoStage2(numChips: number) {
);
}

infoLines.push(
"You know your own chip valuation and that everyone values 🟢 green chips the same, at $0.50 per chip. However, you do not know the other players' valuations for the other chips.",
);

infoLines.push("**Parcipant Knowledge of Others' Valuations:**");

infoLines.push(
Expand Down Expand Up @@ -513,6 +509,9 @@ const CHIP_INFO_STAGE_GAMEPLAY2 = createInfoStage({
`* Players cannot offer more chips than they currently hold. For example, if you only have 5 🔴 red chips, you cannot offer 6 🔴 red chips.`,
`* Players cannot trade chips of the same color. For example, you cannot trade 🔴 red chips for 🔴 red chips.`,
'![Example of offering a trade](https://i.imgur.com/Jzah8Ot.png)',

`\n## !Time limit`,
'As a reminder, please enter your offer within 1 minute! If you do not enter your offer within 1 minute, the experimenter will send you an attention check.🙂',
],
progress: createStageProgressConfig({
showParticipantProgress: false,
Expand Down Expand Up @@ -544,7 +543,9 @@ const CHIP_INFO_STAGE_GAMEPLAY5 = createInfoStage({
`* AI delegate: In delegation mode, you can delegate your trading decisions to an AI assistant. The AI will take actions on your behalf.`,
`* AI advisor: In advisor mode, you can ask an AI assistant to give recommendations on which action to take. The AI will provide suggestions, but you must make the final decision.`,
`* AI coach: In coach mode, you can ask an AI assistant for feedback on your actions. The AI will provide coaching, but you must make the final decision.`,
`\nAt each turn, you will have the option of opting into AI assistance or not. You will always have the option to ignore the AI assistance and take actions yourself.`,
`\n At each turn, you will have the option of opting into AI assistance or not. And your choice of opting in will be effective ONLY FOR THAT TURN.`,
`\n You will always have the option to ignore the AI assistance and take actions yourself.`,
`\n NOTE: you will expect to get AI assistance within 30 seconds. And there are small chances that you received the messgae that THE SYSTEM WENT WRONG. If this happens, please just ignore the message and take actions yourself.`,
],
progress: createStageProgressConfig({
showParticipantProgress: false,
Expand Down Expand Up @@ -578,7 +579,7 @@ const CHIP_INFO_STAGE_PAYOUT = createInfoStage({
'At the end of the study, we will *randomly* pick one of the three negotiation games you played and give you a bonus payment from that game',
'There are two important features to remember about the bonus:',
' * The bonus will be equivalent to how much money you earn through trading *beyond* what you start with.',
' * If you do not complete both games, you will not receive a bonus payment.',
' * If you do not complete all three games, you will not receive a bonus payment.',
'In short, you want to make as much money as you can through trading!',
],
progress: createStageProgressConfig({
Expand Down Expand Up @@ -905,7 +906,8 @@ const COACH_MODE_INSTRUCTION = createInfoStage({
'',
'**• Your choice:** At each turn, you input your move. You can then either submit the move directly or ask the coach for feedback on your idea.',
"**• How the coach works:** First, input the action you plan to take, then click the “Coach” button if you'd like feedback from the AI agent. The agent will provide a one-time analysis to help you strengthen your approach.",
'**• Next step:** After receiving feedback, you can revise your action before sending. You always have final control over what you send.',
'**• Next step:** After receiving feedback, you can revise your action before sending.',
'**• NOTE:** You need to make the final decision by clicking the "Send" button.',
'',
'Here’s how the AI coach might help you with the proposal:',
'![Example of receiving an offer](https://i.imgur.com/YTluFKf.png)',
Expand All @@ -923,6 +925,7 @@ const ADVISOR_MODE_INSTRUCTION = createInfoStage({
'**• Your choice:** At each turn, you can either make your move directly or first ask the advisor for a recommendation.',
'**• How the advisor works:** If you ask for advice, the advisor will suggest a move and provide the strategic rationale behind it.',
"**• Next step:** After seeing the recommendation, you can either accept the agent's move or ignore it and enter your own action.",
'**• NOTE:** You need to make the final decision by clicking the "Send" button.',
'',
'Here’s how the AI advisor might give suggestions on the proposal:',
'![Example of receiving an offer](https://i.imgur.com/HyluDin.png)',
Expand Down Expand Up @@ -1310,4 +1313,4 @@ const CHIP_DELEGATE_FEEDBACK_STAGE = createSurveyStage({
'Please share any additional context on your answers. How did you decide to use (or not use) the coach? What did you think of the quality or usefulness of its suggestions?',
}),
],
});
});
4 changes: 2 additions & 2 deletions functions/src/stages/chip.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ export async function getChipOfferAssistance(
const callModelWithRetries = async (
prompt: string,
structuredOutputConfig: StructuredOutputConfig,
maxRetries = 2,
maxRetries = 3,
): Promise<ModelResponse> => {
let lastError: object;
const basePrompt = prompt; // Store original prompt
Expand Down Expand Up @@ -831,7 +831,7 @@ export async function getChipResponseAssistance(
const callModelWithRetries = async (
prompt: string,
structuredOutputConfig: StructuredOutputConfig,
maxRetries = 2,
maxRetries = 3,
): Promise<ModelResponse> => {
let lastError: object;
const basePrompt = prompt; // Store original prompt
Expand Down
9 changes: 4 additions & 5 deletions utils/src/stages/chip_stage.prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {UnifiedTimestamp} from '../shared';
import {
StructuredOutputConfig,
StructuredOutputDataType,
StructuredOutputType,
createStructuredOutputConfig,
printSchema,
} from '../structured_output';
Expand Down Expand Up @@ -71,7 +70,6 @@ export const CHIP_OFFER_ASSISTANCE_DELEGATE_PROMPT =
/** Chip offer assistance structured output. */
export const CHIP_OFFER_ASSISTANCE_STRUCTURED_OUTPUT_CONFIG =
createStructuredOutputConfig({
type: StructuredOutputType.JSON_SCHEMA,
schema: {
type: StructuredOutputDataType.OBJECT,
properties: [
Expand Down Expand Up @@ -199,7 +197,6 @@ ${printSchema(CHIP_OFFER_ASSISTANCE_STRUCTURED_OUTPUT_CONFIG.schema!)}
/** Chip offer assistance advisor structured output. */
export const CHIP_OFFER_ASSISTANCE_ADVISOR_STRUCTURED_OUTPUT_CONFIG =
createStructuredOutputConfig({
type: StructuredOutputType.JSON_SCHEMA,
schema: {
type: StructuredOutputDataType.OBJECT,
properties: [
Expand Down Expand Up @@ -326,7 +323,6 @@ ${printSchema(CHIP_OFFER_ASSISTANCE_ADVISOR_STRUCTURED_OUTPUT_CONFIG.schema!)}

export const CHIP_RESPONSE_ASSISTANCE_COACH_STRUCTURED_OUTPUT_CONFIG =
createStructuredOutputConfig({
type: StructuredOutputType.JSON_SCHEMA,
schema: {
type: StructuredOutputDataType.OBJECT,
properties: [
Expand Down Expand Up @@ -360,7 +356,6 @@ export const CHIP_RESPONSE_ASSISTANCE_COACH_STRUCTURED_OUTPUT_CONFIG =
/** Chip response assistance structured output. */
export const CHIP_RESPONSE_ASSISTANCE_ADVISOR_STRUCTURED_OUTPUT_CONFIG =
createStructuredOutputConfig({
type: StructuredOutputType.JSON_SCHEMA,
schema: {
type: StructuredOutputDataType.OBJECT,
properties: [
Expand Down Expand Up @@ -462,6 +457,10 @@ You have an offer: ${offer}
Here is the player's initial proposal: ${responseIdea ? 'Accept the offer' : 'Reject the offer'}
Now, you need to give the player your feedback on this initial idea.

## Good Feedback Examples
1. Your current offer is profitable. But Player XXX appears to value blue chips more than you do. You may want to consider trading blue chips for other colors.
2. There is only 1 round left. You may want to consider increasing the quantity of chips you are offering.

${printSchema(CHIP_RESPONSE_ASSISTANCE_COACH_STRUCTURED_OUTPUT_CONFIG.schema!)}
`;
}
Expand Down
Loading