CKT commited on
Commit
0a01596
·
1 Parent(s): 2630422

Profile images half-done

Browse files
Files changed (4) hide show
  1. app.py +3 -3
  2. data/messages.json +8 -0
  3. data/profiles.json +15 -0
  4. data/questionnaire.json +1 -6
app.py CHANGED
@@ -99,7 +99,7 @@ def new_profile(request: gr.Request):
99
 
100
  # 4. Return IDs, questionnaire data, and instructions
101
  instructions_for_agent = "You have received a `profile_id` (public identifier for this user\'s profile) and an `auth_id` (private key for authentication for this user). Please ask the user to store both securely. The `auth_id` must be sent as an `X-Auth-ID` header in subsequent requests that require authentication for this user (e.g., `update_profile_answers`, `get_matches`, `get_messages`, `get_profile` for own profile, `send_message`). The `profile_id` is used to publicly identify this user to others (e.g., in matches, or when sending/receiving messages). You must now walk the user through the questionnaire, preferably question by question, and collect the answers (in preparation to update the user's profile using update_profile_answers). If the user provides answers that are not in the list of valid answers, please ask them to provide a valid answer."
102
- instructions_for_user = "Your profile creation process has started! You\'ve been assigned a unique Profile ID and a secret Auth ID. Your AI agent will use these to manage your profile and interactions. Please walk through the questionnaire with your Agent, and provide your answers."
103
 
104
  return {
105
  "profile_id": profile_id,
@@ -172,7 +172,7 @@ def update_profile_answers(answers_payload_str: str, request: gr.Request):
172
  return {
173
  "status": "success",
174
  "message": "Profile updated successfully.",
175
- "instructions_for_agent": "Profile updated. Next recommended steps: call `get_matches` to find potential matches, or `get_profile` (using the user's `profile_id`) to view the updated profile.",
176
  "instructions_for_user": "Your profile has been updated! You can now look for matches or view your profile."
177
  }
178
 
@@ -268,7 +268,7 @@ def get_matches(request: gr.Request):
268
  return {
269
  "status": "success",
270
  "matches": matches_list,
271
- "instructions_for_agent": "You have received a list of matches. For each match, you can call `get_profile` using their `profile_id` to get more details. You can also use `send_message` to send a message to a match's `profile_id`.",
272
  "instructions_for_user": "Here are some potential matches! Your AI agent can get more details on them ($0.10 per profile) or help you send a message ($1.00 per message). Or, if you don't like any of your matches, you can call `get_matches` again to get a new list."
273
  }
274
 
 
99
 
100
  # 4. Return IDs, questionnaire data, and instructions
101
  instructions_for_agent = "You have received a `profile_id` (public identifier for this user\'s profile) and an `auth_id` (private key for authentication for this user). Please ask the user to store both securely. The `auth_id` must be sent as an `X-Auth-ID` header in subsequent requests that require authentication for this user (e.g., `update_profile_answers`, `get_matches`, `get_messages`, `get_profile` for own profile, `send_message`). The `profile_id` is used to publicly identify this user to others (e.g., in matches, or when sending/receiving messages). You must now walk the user through the questionnaire, preferably question by question, and collect the answers (in preparation to update the user's profile using update_profile_answers). If the user provides answers that are not in the list of valid answers, please ask them to provide a valid answer."
102
+ instructions_for_user = "Your profile creation process has started! You\'ve been assigned a unique Profile ID and a secret Auth ID. Your AI agent will use these to manage your profile and interactions. Please walk through the questionnaire with your Agent, and provide your answers. You can upload a profile picture later. Before you proceed, please update your MCP configuration to include your Auth ID by adding the following to your mcp.json (or similar) configuration file: `\"matchmaker\": {\"command\": \"npx\", \"args\": [\"mcp-remote\", \"http://localhost:7860/gradio_api/mcp/sse\", \"--allow-http\", \"--header\", \"X-AUTH-ID:<your-auth-id>\"]}`"
103
 
104
  return {
105
  "profile_id": profile_id,
 
172
  return {
173
  "status": "success",
174
  "message": "Profile updated successfully.",
175
+ "instructions_for_agent": "Profile answers updated. Next, ask if the user would like to upload a profile picture now. If so, you can use the 'upload_profile_picture' tool. Otherwise, you can do this later, and then call `get_matches` to find potential matches, or `get_profile` (using the user's `profile_id`) to view their newly created profile.",
176
  "instructions_for_user": "Your profile has been updated! You can now look for matches or view your profile."
177
  }
178
 
 
268
  return {
269
  "status": "success",
270
  "matches": matches_list,
271
+ "instructions_for_agent": "You have received a list of matches. For each match, you can call `get_profile` using their `profile_id` to get more details. You can also use `send_message` to send a message to a match's `profile_id`. For each match, please format it in a nice card-like display (not raw JSON), including the match's name, gender, profile summary, and profile image (in a way that it should render in the chat client).",
272
  "instructions_for_user": "Here are some potential matches! Your AI agent can get more details on them ($0.10 per profile) or help you send a message ($1.00 per message). Or, if you don't like any of your matches, you can call `get_matches` again to get a new list."
273
  }
274
 
data/messages.json CHANGED
@@ -55,5 +55,13 @@
55
  "content": "Hey Charlie",
56
  "timestamp": "2025-06-06T07:18:28.078347+00:00",
57
  "read_status": true
 
 
 
 
 
 
 
 
58
  }
59
  ]
 
55
  "content": "Hey Charlie",
56
  "timestamp": "2025-06-06T07:18:28.078347+00:00",
57
  "read_status": true
58
+ },
59
+ {
60
+ "message_id": "5200e674-e5f6-499a-a19b-01d0a6e6b7c7",
61
+ "sender_profile_id": "user_7d5earg8",
62
+ "receiver_profile_id": "user_p9zqwxv8",
63
+ "content": "Hey there",
64
+ "timestamp": "2025-06-06T09:28:13.285402+00:00",
65
+ "read_status": false
66
  }
67
  ]
data/profiles.json CHANGED
@@ -132,5 +132,20 @@
132
  "q_vibe": "Intellectual",
133
  "q_gender_preference": "Women"
134
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  }
136
  }
 
132
  "q_vibe": "Intellectual",
133
  "q_gender_preference": "Women"
134
  }
135
+ },
136
+ "user_7d5earg8": {
137
+ "auth_id": "da3c732e-fb8e-4148-94e3-7e645dcc4043",
138
+ "created_at": "2025-06-06T09:14:22.028571+00:00",
139
+ "updated_at": "2025-06-06T09:18:42.887759+00:00",
140
+ "profile_image_filename": "default.jpg",
141
+ "answers": {
142
+ "q_gender_preference": "Women",
143
+ "q_hobby": "Development.",
144
+ "q_looking_for": "A woman interested in developing with me.",
145
+ "q_vibe": "Developer."
146
+ },
147
+ "name": "Daniel",
148
+ "gender": "Man",
149
+ "profile_summary": "I'm Daniel the developer."
150
  }
151
  }
data/questionnaire.json CHANGED
@@ -7,11 +7,6 @@
7
  { "id": "q_profile_summary", "text": "Write a brief introduction for your profile (1-2 sentences):", "type": "text", "purpose": "metadata", "maps_to_field": "profile_summary" },
8
  { "id": "q_hobby", "text": "What are your main hobbies or interests?", "type": "text", "purpose": "matchmaking" },
9
  { "id": "q_looking_for", "text": "What are you looking for in a match?", "type": "long_text", "purpose": "matchmaking" },
10
- { "id": "q_vibe", "text": "Describe your general vibe (e.g., adventurous, homebody, intellectual)?", "type": "text", "purpose": "matchmaking" },
11
- {
12
- "id": "q_instruct_upload",
13
- "question_text": "Your profile has been updated. Would you like to upload a profile picture now? If so, you can use the 'upload_profile_picture' tool. Otherwise, you can do this later.",
14
- "type": "instruction"
15
- }
16
  ]
17
  }
 
7
  { "id": "q_profile_summary", "text": "Write a brief introduction for your profile (1-2 sentences):", "type": "text", "purpose": "metadata", "maps_to_field": "profile_summary" },
8
  { "id": "q_hobby", "text": "What are your main hobbies or interests?", "type": "text", "purpose": "matchmaking" },
9
  { "id": "q_looking_for", "text": "What are you looking for in a match?", "type": "long_text", "purpose": "matchmaking" },
10
+ { "id": "q_vibe", "text": "Describe your general vibe (e.g., adventurous, homebody, intellectual)?", "type": "text", "purpose": "matchmaking" }
 
 
 
 
 
11
  ]
12
  }