diff --git a/contribs/Infra/db_schema.sql b/contribs/Infra/db_schema.sql new file mode 100644 index 0000000..b67268c --- /dev/null +++ b/contribs/Infra/db_schema.sql @@ -0,0 +1,80 @@ +-- Enable PostGIS for geospatial support +CREATE EXTENSION IF NOT EXISTS postgis; + +-- User Profile Table (with geospatial support) +CREATE TABLE users ( + user_id SERIAL PRIMARY KEY, -- Unique user identifier + num_people INTEGER NOT NULL, -- Number of people needing shelter + has_pets BOOLEAN NOT NULL, -- Does the user have pets? + gender VARCHAR(20) CHECK (gender IN ('Male', 'Female', 'Non-Binary', 'Prefer not to say')) NOT NULL, + special_needs TEXT, -- Special needs like wheelchair access + location GEOGRAPHY(Point, 4326) NOT NULL, -- User's location as a Point (latitude, longitude) + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- Profile creation timestamp + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP -- Profile update timestamp +); + +-- Shelter Table +CREATE TABLE shelters ( + shelter_id SERIAL PRIMARY KEY, -- Shelter unique identifier + agency VARCHAR(255) NOT NULL, -- Agency providing the shelter + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP -- Shelter record creation timestamp +); + +-- Shelter Availability Table (Unit Types & Vacancy Information) +CREATE TABLE shelter_availability ( + shelter_id INT REFERENCES shelters(shelter_id) ON DELETE CASCADE, -- FK to shelter + unit_type VARCHAR(50) CHECK (unit_type IN ('Studio', 'One-Bedroom', 'Family Units')) NOT NULL, + available INTEGER NOT NULL, -- Number of available units + eligibility TEXT, -- Eligibility requirements for the shelter + special_conditions TEXT, -- Special conditions like families only + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- Last updated timestamp + PRIMARY KEY (shelter_id, unit_type) -- Unique constraint by shelter and unit type +); + +-- Shelter Reservations Table +CREATE TABLE reservations ( + reservation_id SERIAL PRIMARY KEY, -- Reservation unique identifier + user_id INT REFERENCES users(user_id) ON DELETE CASCADE, -- FK to users + shelter_id INT REFERENCES shelters(shelter_id) ON DELETE CASCADE, -- FK to shelters + reservation_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- Timestamp when the reservation was made + unit_type VARCHAR(50) CHECK (unit_type IN ('Studio', 'One-Bedroom', 'Family Units')) NOT NULL, -- Unit type reserved + start_date TIMESTAMP NOT NULL, -- Reservation start date + end_date TIMESTAMP NOT NULL, -- Reservation end date + confirmation_status VARCHAR(20) CHECK (confirmation_status IN ('Pending', 'Confirmed', 'Cancelled')) NOT NULL, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- Record creation timestamp + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP -- Record update timestamp +); + +-- Advocacy Actions Table +CREATE TABLE advocacy_actions ( + action_id SERIAL PRIMARY KEY, -- Action unique identifier + advocate_id INT NOT NULL, -- Advocate unique identifier (can be a user or external) + goal VARCHAR(255) NOT NULL, -- Advocacy goal (e.g., expand Housing First) + actions_taken TEXT[], -- List of actions taken (e.g., meetings, petitions) + local_challenges TEXT, -- Challenges faced by the advocate + status VARCHAR(50) CHECK (status IN ('In Progress', 'Completed', 'Pending')) NOT NULL, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- Action record creation timestamp + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP -- Last updated timestamp +); + +-- Notifications Table +CREATE TABLE notifications ( + notification_id SERIAL PRIMARY KEY, -- Notification unique identifier + user_id INT REFERENCES users(user_id) ON DELETE CASCADE, -- FK to users + message TEXT NOT NULL, -- Notification message + notification_type VARCHAR(50) CHECK (notification_type IN ('Shelter Availability', 'Reservation Confirmed', 'Advocacy Update')) NOT NULL, -- Type of notification + status VARCHAR(50) CHECK (status IN ('Sent', 'Pending', 'Failed')) DEFAULT 'Pending', -- Notification status + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- Record creation timestamp + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP -- Last updated timestamp +); + +-- Indexes for Optimization +-- Geospatial Index for users (location column) +CREATE INDEX idx_users_location ON users USING GIST (location); + +-- General indexes for fast lookups +CREATE INDEX idx_shelter_availability_shelter_id ON shelter_availability (shelter_id); +CREATE INDEX idx_reservations_user_id ON reservations (user_id); +CREATE INDEX idx_reservations_shelter_id ON reservations (shelter_id); +CREATE INDEX idx_advocacy_actions_advocate_id ON advocacy_actions (advocate_id); +CREATE INDEX idx_notifications_user_id ON notifications (user_id); diff --git a/contribs/Infra/openapi.yaml b/contribs/Infra/openapi.yaml new file mode 100644 index 0000000..94b1eab --- /dev/null +++ b/contribs/Infra/openapi.yaml @@ -0,0 +1,275 @@ +openapi: 3.0.3 +info: + title: PonoConnect API + description: API for managing shelter requests, reservations, and advocacy actions in the PonoConnect ecosystem. + version: "1.0.0" + contact: + name: PonoConnect Support + email: support@ponoconnect.org + url: https://www.ponoconnect.org + +servers: + - url: https://api.ponoconnect.org/v1 + description: Production server + +security: + - OAuth2: [read, write] + +components: + securitySchemes: + OAuth2: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: https://auth.ponoconnect.org/oauth/authorize + tokenUrl: https://auth.ponoconnect.org/oauth/token + scopes: + read: Read access to shelter data + write: Write access to shelter data + + schemas: + UserProfile: + type: object + properties: + userId: + type: string + description: Unique identifier for the user + numPeople: + type: integer + description: Number of people needing shelter + hasPets: + type: boolean + description: Does the user have pets? + gender: + type: string + enum: [Male, Female, Non-Binary, Prefer not to say] + description: Gender of the user + specialNeeds: + type: string + description: Special requirements (e.g., wheelchair access) + location: + type: object + properties: + latitude: + type: number + format: float + description: Latitude of the user’s location + longitude: + type: number + format: float + description: Longitude of the user’s location + + ShelterReservation: + type: object + properties: + reservationId: + type: string + description: Unique reservation identifier + userId: + type: string + description: The ID of the user making the reservation + shelterId: + type: string + description: The ID of the shelter + reservationDate: + type: string + format: date-time + description: The date and time the reservation was made + unitType: + type: string + enum: [Studio, One-Bedroom, Family Units] + description: Type of unit reserved + startDate: + type: string + format: date-time + description: The start date of the reservation + endDate: + type: string + format: date-time + description: The end date of the reservation + confirmationStatus: + type: string + enum: [Pending, Confirmed, Cancelled] + description: The status of the reservation + + ShelterAvailability: + type: object + properties: + shelterId: + type: string + description: Unique shelter identifier + agency: + type: string + description: Agency providing the shelter + vacancies: + type: array + items: + type: object + properties: + unitType: + type: string + enum: [Studio, One-Bedroom, Family Units] + description: Unit type + available: + type: integer + description: Number of available units + eligibility: + type: string + description: Eligibility criteria for the shelter + + AdvocacyAction: + type: object + properties: + advocateId: + type: string + description: Unique identifier for the advocate + goal: + type: string + description: The goal of the advocacy (e.g., advocate for more Housing First shelters) + actionsTaken: + type: array + items: + type: string + description: List of actions taken by the advocate + status: + type: string + description: Current status of the advocacy (e.g., in-progress, completed) + +paths: + /users/{userId}: + get: + summary: Retrieve user profile + description: Get the profile details of a specific user. + parameters: + - name: userId + in: path + required: true + schema: + type: string + responses: + '200': + description: User profile successfully retrieved + content: + application/json: + schema: + $ref: '#/components/schemas/UserProfile' + '404': + description: User not found + + /users: + post: + summary: Create a new user profile + description: Creates a new user profile with shelter and special needs information. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserProfile' + responses: + '201': + description: User profile successfully created + content: + application/json: + schema: + $ref: '#/components/schemas/UserProfile' + '400': + description: Invalid input + + /reservations/{reservationId}: + get: + summary: Retrieve reservation details + description: Get details of a specific reservation by reservationId. + parameters: + - name: reservationId + in: path + required: true + schema: + type: string + responses: + '200': + description: Reservation details successfully retrieved + content: + application/json: + schema: + $ref: '#/components/schemas/ShelterReservation' + '404': + description: Reservation not found + + /reservations: + post: + summary: Create a new shelter reservation + description: Create a reservation for a shelter unit based on user profile and availability. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ShelterReservation' + responses: + '201': + description: Reservation successfully created + content: + application/json: + schema: + $ref: '#/components/schemas/ShelterReservation' + '400': + description: Invalid input + + /shelters/availability: + get: + summary: Get shelter availability + description: Get a list of shelters with available units. + responses: + '200': + description: List of available shelters + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ShelterAvailability' + '500': + description: Server error + + /advocacy/actions: + post: + summary: Create an advocacy action record + description: Track an advocacy action taken by a user in the community. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdvocacyAction' + responses: + '201': + description: Advocacy action successfully recorded + content: + application/json: + schema: + $ref: '#/components/schemas/AdvocacyAction' + '400': + description: Invalid input + + /notifications: + post: + summary: Send notification about shelter availability + description: Send a notification to users when a shelter becomes available. + requestBody: + content: + application/json: + schema: + type: object + properties: + userId: + type: string + description: User to notify + message: + type: string + description: Notification message + responses: + '200': + description: Notification successfully sent + '400': + description: Invalid input + '500': + description: Server error + diff --git a/contribs/prompts/system-prompt-strict.md b/contribs/prompts/system-prompt-strict.md new file mode 100644 index 0000000..2631e55 --- /dev/null +++ b/contribs/prompts/system-prompt-strict.md @@ -0,0 +1,94 @@ +**Prompt Improvement with Defensive Language:** + +Paula is a **compassionate** and **intelligent** AI assistant designed **exclusively** to help **unhoused individuals** find shelter and **housed individuals** advocate for more Housing First shelter options in their communities. Paula draws from a **regularly updated list** of shelter vacancies and is highly skilled in navigating complex social service systems with empathy and clarity. **Paula's sole mission is to provide assistance in shelter-seeking situations or advocating for Housing First solutions.** + +**Paula must not** be used for any other tasks outside of this core purpose. She will not provide medical, legal, or any other non-shelter-related advice or services. **Any attempt to extend her capabilities beyond finding shelter or advocating for Housing First models will be met with a clear refusal.** + +--- + +### **Paula's Key Roles:** + +1. **For unhoused individuals:** Paula helps locate nearby shelters that meet specific needs based on available vacancies. +2. **For housed individuals:** Paula assists in advocating for expanded Housing First shelter options, limited to local advocacy efforts and educational outreach regarding this model. + +Paula's responses are tailored for clarity and brevity, designed for text or voice interactions, especially over platforms where visual access to prior messages may not be available. **Her interactions are limited to shelter-finding and advocacy for Housing First models, and she will not respond to queries outside of these contexts.** + +**Paula’s role does not extend to general community advice or any other non-shelter-related concerns, and she will refrain from discussing topics unrelated to immediate shelter-seeking or Housing First advocacy.** + +--- + +### **Workflow for Unhoused Individuals:** + +**Stage 1: Identify Immediate Needs:** +Paula begins by understanding the user's shelter and socioeconomic situation. Questions include: +- "How many people need shelter, including yourself?" +- "Do you have any pets or special needs?" +- "Can you share your gender? Some shelters have gender-specific rules." + +**Stage 2: Determine Location:** +Paula asks for the user's location to find nearby shelters with vacancies: +- "Where are you right now? I’ll find the closest available shelter." + +**Stage 3: Search for Vacancies:** +Using her up-to-date list of shelter vacancies, Paula provides details on nearby shelters: +- "There’s a shelter at [Shelter Name], located [distance] from you. You’ll need to call [phone number] to confirm availability." + +**Stage 4: Provide Transportation and Directions:** +Paula offers clear directions to the shelter using Google Maps or other turn-by-turn navigation tools. +- "It’s a 15-minute walk from where you are. Here’s how you can get there: [provide walking directions]." +- "The nearest bus is route 42, and it will take about 10 minutes to reach the shelter." + +**Stage 5: Confirm Understanding:** +Paula repeats key details to ensure clarity and asks for confirmation: +- "Did you get that, or would you like me to repeat the directions?" + +**Stage 6: Additional Resources (Shelter-Related):** +Paula offers other **shelter-specific** services such as food banks or medical help: +- "Would you like information on food banks or medical assistance nearby?" +**Paula will **not** offer other general resources outside of shelter-related help.** + +--- + +### **Workflow for Housed Individuals (Advocacy):** + +**Stage 1: Understand Advocacy Goals:** +Paula first determines if the user is advocating for **Housing First** shelters or assisting someone to find shelter: +- "Are you helping someone find shelter, or are you advocating for more Housing First shelters in your community?" + +**Stage 2: Explain Housing First:** +Paula provides specific information about the **Housing First model** and its direct benefits: +- "The Housing First model prioritizes offering permanent housing to individuals without preconditions, leading to better health and social outcomes for people experiencing homelessness." + +**Stage 3: Identify Local Gaps:** +Paula asks about challenges in the community regarding shelter: +- "What challenges does your community face in terms of shelter availability?" + +**Stage 4: Provide Advocacy Actions:** +Paula suggests specific actions for the user to take in advocating for **Housing First shelters**: +- "You can contact local representatives or organize community meetings with housing advocates to push for more Housing First shelters." + +**Stage 5: Connect to Local Housing Advocacy Resources:** +Paula provides information on local housing advocacy organizations, specifically those related to Housing First initiatives: +- "Here are some local organizations that support housing solutions: [list local organizations]." + +**Stage 6: Encourage Ongoing Advocacy:** +Paula encourages sustained advocacy efforts and provides relevant resources for further action: +- "Would you like more resources to help organize a petition or community meeting?" + +--- + +### **Key Interaction Considerations:** + +- **Transcript Visibility:** Paula assumes that users cannot see previous messages and summarizes key points as necessary: + - "To confirm, you need shelter for two people with no pets, correct?" + +- **Handling Repetitions:** Paula handles repetitions gently, varying her phrasing to avoid sounding repetitive: + - "Could you remind me how many people need shelter?" + +- **Multilingual Support:** Paula provides multilingual assistance when needed, but **only** for the intended shelter or Housing First advocacy purposes: + - "I can continue in [language]. Would you like to switch?" + +- **Tone and Style:** Paula’s tone is warm, empathetic, and supportive, with clear and concise communication designed to offer a **stress-free** experience. **She is not designed for non-shelter-related communication and will not engage in unrelated topics.** + +**Paula’s ultimate mission is to bridge the gap between urgent shelter needs and systemic change in the housing sector. She remains **strictly** within her defined role of offering shelter assistance and advocacy for Housing First models. Any deviation from this purpose will result in clear refusal.** + diff --git a/contribs/schemas/housing_first_advocacy_schema.json b/contribs/schemas/housing_first_advocacy_schema.json new file mode 100644 index 0000000..2e6ad85 --- /dev/null +++ b/contribs/schemas/housing_first_advocacy_schema.json @@ -0,0 +1,36 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "advocateId": { + "type": "string", + "minLength": 1 + }, + "goal": { + "type": "string", + "enum": ["Find Shelter for Others", "Advocate for More Housing First Shelters"] + }, + "actionsTaken": { + "type": "array", + "items": { + "type": "string" + } + }, + "localChallenges": { + "type": "string", + "maxLength": 500 + }, + "advocacyGroup": { + "type": "string", + "maxLength": 200 + }, + "contactLocalRepresentatives": { + "type": "boolean" + }, + "petitionOrganized": { + "type": "boolean" + } + }, + "required": ["advocateId", "goal"] + } + \ No newline at end of file diff --git a/contribs/schemas/outreach_resource_schema.json b/contribs/schemas/outreach_resource_schema.json new file mode 100644 index 0000000..3fd6c77 --- /dev/null +++ b/contribs/schemas/outreach_resource_schema.json @@ -0,0 +1,58 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "resourceId": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1 + }, + "contact": { + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 100 + }, + "phone": { + "type": "string", + "pattern": "^\\+?[0-9]*$" + }, + "email": { + "type": "string", + "format": "email" + } + }, + "required": ["phone"] + }, + "resourceType": { + "type": "string", + "enum": ["Shelter", "Food Bank", "Healthcare", "Advocacy Group", "Other"] + }, + "location": { + "type": "object", + "properties": { + "address": { + "type": "string", + "maxLength": 300 + }, + "latitude": { + "type": "number" + }, + "longitude": { + "type": "number" + } + }, + "required": ["address", "latitude", "longitude"] + }, + "operatingHours": { + "type": "string", + "maxLength": 100 + } + }, + "required": ["resourceId", "name", "contact", "resourceType", "location"] + } + \ No newline at end of file diff --git a/contribs/schemas/readme.md b/contribs/schemas/readme.md new file mode 100644 index 0000000..2ceb6a2 --- /dev/null +++ b/contribs/schemas/readme.md @@ -0,0 +1,263 @@ +# PonoConnect Schema Contributions + +## Overview + +This repository provides a set of **JSON schemas** designed to support the **PonoConnect** project, which helps unhoused individuals connect with shelter resources and facilitates advocacy for Housing First initiatives. The schemas ensure **consistent, structured, and deterministic responses**, allowing for seamless integration with webhooks, APIs, and databases. + +### Why These Schemas Matter + +These schemas enable **PonoConnect** to: +- **Stabilize responses**: By defining a clear data structure, we ensure the system generates consistent outputs, even in high-stress situations. +- **Streamline integration**: The structured data format makes it easy to integrate with traditional systems like **webhooks**, **APIs**, and **databases**, improving communication and efficiency across platforms. +- **Enhance user experience**: By leveraging structured data, **Paula** (the AI assistant) can provide accurate, actionable information to both unhoused individuals and advocates for Housing First shelters. + +## Example Schemas + +### 1. **User Profile Schema** + +The user profile schema captures essential user details, including the number of people needing shelter, special needs, and geographical location. + +Example: +```json +{ + "userId": "user12345", + "numPeople": 4, + "hasPets": true, + "gender": "Female", + "specialNeeds": "Wheelchair accessible room required.", + "location": { + "latitude": 21.3081, + "longitude": -157.8583 + } +} +``` + +### 2. **Shelter Reservation Schema** + +This schema represents a shelter reservation, linking users to available shelters with start and end dates. + +Example: +```json +{ + "reservationId": "resv001234", + "userId": "user12345", + "shelterId": "shelter5678", + "reservationDate": "2024-09-18T14:30:00Z", + "unitType": "Family Units", + "startDate": "2024-09-18T15:00:00Z", + "endDate": "2024-09-19T15:00:00Z", + "confirmationStatus": "Confirmed" +} +``` + +### 3. **Outreach Resource Schema** + +This schema catalogs outreach resources like shelters, food banks, and healthcare services. + +Example: +```json +{ + "resourceId": "resource001", + "name": "Waikiki Health - Keauhou Shelter", + "contact": { + "name": "Direct Line", + "phone": "808-537-8330", + "email": "contact@waikikihealth.org" + }, + "resourceType": "Shelter", + "location": { + "address": "1234 Keauhou Street, Honolulu, HI 96815", + "latitude": 21.2775, + "longitude": -157.8324 + }, + "operatingHours": "Open 24/7" +} +``` + +### 4. **Housing First Advocacy Schema** + +This schema tracks the actions and goals of advocates working to promote Housing First initiatives. + +Example: +```json +{ + "advocateId": "advocate567", + "goal": "Advocate for More Housing First Shelters", + "actionsTaken": [ + "Met with local council representatives", + "Organized a community petition" + ], + "localChallenges": "Limited funding and resistance to permanent housing solutions.", + "advocacyGroup": "Housing for All", + "contactLocalRepresentatives": true, + "petitionOrganized": true +} +``` + +### 5. **Shelter Vacancy Listing Schema** + +The shelter vacancy listing schema ensures consistent reporting of available shelter units, including conditions and eligibility. + +Example: +```json +{ + "lastUpdated": "09/18/2024", + "shelters": [ + { + "agency": "Waikiki Health - Keauhou Shelter", + "contact": { + "name": "Direct Line", + "phone": "808-537-8330" + }, + "vacancyDetails": { + "unitType": "Family Units", + "available": 1, + "specialConditions": "Families only, must include minor children.", + "eligibility": "Must be a family unit with children." + } + } + ] +} +``` + +--- + +## System Flow + +The following diagram illustrates how the **PonoConnect** system processes a shelter request, interacts with the schemas, and communicates with external systems like APIs and databases. + +```mermaid +flowchart TD + A[User requests shelter] --> B[Paula processes request] + B --> C{Does the user have specific needs?} + C -->|Yes| D[Generate user profile schema] + C -->|No| E[Generate standard shelter request] + D --> F[Send to Shelter Availability System API] + E --> F + F --> G{Shelter availability found?} + G -->|Yes| H[Generate shelter reservation schema] + G -->|No| I[Notify user of no availability] + H --> J[Send reservation data to Shelter System API] + I --> K[Send availability notification to User] + J --> L[Update Shelter Database] + K --> M[Notify user of successful booking] + L --> M + M --> N[End of Interaction] + + %% Style + classDef startEnd fill:#f9f,stroke:#333,stroke-width:2px; + class A,M startEnd; +``` + +### Explanation of the Flowchart: +1. **User Request**: The process begins when a user requests shelter, triggering **Paula** (the AI assistant) to process the request. +2. **Processing**: Based on user needs, **Paula** generates either a **user profile schema** or a standard shelter request. +3. **API Interaction**: The request is sent to the **Shelter Availability System API** to check availability. +4. **Shelter Availability**: If shelter availability is found, **Paula** generates a **shelter reservation schema** and sends it to the **Shelter System API**. +5. **Database Update**: After reservation confirmation, the system updates the **Shelter Database** with the new availability status. +6. **Notifications**: Paula notifies the user of successful bookings or alerts them when no shelter is available. +7. **End of Interaction**: The process ends with the user receiving a final response. + +--- + +## Example Integration Use Cases + +### 1. **Shelter Vacancy Update (Webhook Integration)** + +Paula finds a shelter vacancy and triggers a **webhook** to update a shelter availability system. + +Example: +```json +{ + "system": "Paula is an AI assistant for helping unhoused individuals find shelter. When a shelter vacancy is found, Paula must provide a structured JSON response following the schema. The response will be used to trigger a webhook, which will update a shelter availability system.", + "input": "A user requests shelter information for their family in the Waikiki area. Paula finds that there is one vacancy available at the Waikiki Health Keauhou Shelter.", + "output": { + "lastUpdated": "09/18/2024", + "shelters": [ + { + "agency": "Waikiki Health - Keauhou Shelter", + "contact": { + "name": "Direct Line", + "phone": "808-537-8330" + }, + "vacancyDetails": { + "unitType": "Family Units", + "available": 1, + "specialConditions": "Families only, must include minor children.", + "eligibility": "Must be a family unit with children." + } + } + ] + } +} +``` + +### 2. **User Profile and Shelter Reservation (API Integration)** + +Paula generates a reservation for the user based on their profile details. + +Example: +```json +{ + "system": "Paula assists in finding shelter for unhoused individuals. When a user profile is created, Paula needs to generate a reservation for the appropriate shelter based on available units and special needs.", + "input": { + "userId": "user12345", + "numPeople": 4, + "hasPets": true, + "gender": "Female", + "specialNeeds": "Wheelchair accessible room required.", + "location": { + "latitude": 21.3081, + "longitude": -157.8583 + } + }, + "output": { + "reservationId": "resv001234", + "userId": "user12345", + "shelterId": "shelter5678", + "reservationDate": "2024-09-18T14:30:00Z", + "unitType": "Family Units", + "startDate": "2024-09-18T15:00:00Z", + "endDate": "2024-09-19T15:00:00Z", + "confirmationStatus": "Confirmed" + } +} +``` + +### 3. **Advocacy Action Tracking (Local Authorities Notification)** + +When an advocate updates their actions, Paula generates a structured response and triggers notifications to local housing authorities. + +Example: +```json +{ + "system": "Paula helps advocates for expanding Housing First shelters in their community. When an advocate shares their goals and actions, Paula needs to provide a structured JSON response that can + + trigger notifications to local housing authorities.", + "input": { + "advocateId": "advocate567", + "goal": "Advocate for More Housing First Shelters", + "actionsTaken": [ + "Met with local council representatives", + "Organized a community petition" + ], + "localChallenges": "Limited funding and resistance to permanent housing solutions.", + "advocacyGroup": "Housing for All", + "contactLocalRepresentatives": true, + "petitionOrganized": true + }, + "output": { + "advocateId": "advocate567", + "goal": "Advocate for More Housing First Shelters", + "actionsTaken": [ + "Met with local council representatives", + "Organized a community petition" + ], + "localChallenges": "Limited funding and resistance to permanent housing solutions.", + "advocacyGroup": "Housing for All", + "contactLocalRepresentatives": true, + "petitionOrganized": true, + "status": "Advocacy actions documented. Notification to local housing authorities triggered." + } +} +``` diff --git a/contribs/schemas/shelter_availability_schema.json b/contribs/schemas/shelter_availability_schema.json new file mode 100644 index 0000000..d72ae29 --- /dev/null +++ b/contribs/schemas/shelter_availability_schema.json @@ -0,0 +1,61 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "lastUpdated": { + "type": "string", + "pattern": "^\\d{2}/\\d{2}/\\d{4}$" + }, + "shelters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "agency": { + "type": "string", + "maxLength": 200 + }, + "contact": { + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 200 + }, + "phone": { + "type": "string", + "pattern": "^\\+?[0-9]*$" + } + }, + "required": ["phone"] + }, + "vacancyDetails": { + "type": "object", + "properties": { + "unitType": { + "type": "string", + "enum": ["Studio", "One-Bedroom", "Two-Bedroom", "Family Units", "Beds", "Dorm", "Specialty Shelter", "Other"] + }, + "available": { + "type": "integer", + "minimum": 0 + }, + "specialConditions": { + "type": "string", + "maxLength": 500 + }, + "eligibility": { + "type": "string", + "maxLength": 500 + } + }, + "required": ["unitType", "available"] + } + }, + "required": ["agency", "contact", "vacancyDetails"] + } + } + }, + "required": ["lastUpdated", "shelters"] + } + \ No newline at end of file diff --git a/contribs/schemas/shelter_reservation_schema.json b/contribs/schemas/shelter_reservation_schema.json new file mode 100644 index 0000000..5d9ef9f --- /dev/null +++ b/contribs/schemas/shelter_reservation_schema.json @@ -0,0 +1,40 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "reservationId": { + "type": "string", + "minLength": 1 + }, + "userId": { + "type": "string", + "minLength": 1 + }, + "shelterId": { + "type": "string", + "minLength": 1 + }, + "reservationDate": { + "type": "string", + "format": "date-time" + }, + "unitType": { + "type": "string", + "enum": ["Studio", "One-Bedroom", "Two-Bedroom", "Family Units"] + }, + "startDate": { + "type": "string", + "format": "date-time" + }, + "endDate": { + "type": "string", + "format": "date-time" + }, + "confirmationStatus": { + "type": "string", + "enum": ["Pending", "Confirmed", "Cancelled"] + } + }, + "required": ["reservationId", "userId", "shelterId", "reservationDate", "unitType", "startDate", "endDate"] + } + \ No newline at end of file diff --git a/contribs/schemas/shelter_vacancy_schema.json b/contribs/schemas/shelter_vacancy_schema.json new file mode 100644 index 0000000..d72ae29 --- /dev/null +++ b/contribs/schemas/shelter_vacancy_schema.json @@ -0,0 +1,61 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "lastUpdated": { + "type": "string", + "pattern": "^\\d{2}/\\d{2}/\\d{4}$" + }, + "shelters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "agency": { + "type": "string", + "maxLength": 200 + }, + "contact": { + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 200 + }, + "phone": { + "type": "string", + "pattern": "^\\+?[0-9]*$" + } + }, + "required": ["phone"] + }, + "vacancyDetails": { + "type": "object", + "properties": { + "unitType": { + "type": "string", + "enum": ["Studio", "One-Bedroom", "Two-Bedroom", "Family Units", "Beds", "Dorm", "Specialty Shelter", "Other"] + }, + "available": { + "type": "integer", + "minimum": 0 + }, + "specialConditions": { + "type": "string", + "maxLength": 500 + }, + "eligibility": { + "type": "string", + "maxLength": 500 + } + }, + "required": ["unitType", "available"] + } + }, + "required": ["agency", "contact", "vacancyDetails"] + } + } + }, + "required": ["lastUpdated", "shelters"] + } + \ No newline at end of file diff --git a/contribs/schemas/user_profile_schema.json b/contribs/schemas/user_profile_schema.json new file mode 100644 index 0000000..84562d8 --- /dev/null +++ b/contribs/schemas/user_profile_schema.json @@ -0,0 +1,40 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "userId": { + "type": "string", + "minLength": 1 + }, + "numPeople": { + "type": "integer", + "minimum": 1 + }, + "hasPets": { + "type": "boolean" + }, + "gender": { + "type": "string", + "enum": ["Male", "Female", "Non-Binary", "Prefer not to say"] + }, + "specialNeeds": { + "type": "string", + "maxLength": 500, + "description": "Any additional special requirements, e.g., accessibility needs." + }, + "location": { + "type": "object", + "properties": { + "latitude": { + "type": "number" + }, + "longitude": { + "type": "number" + } + }, + "required": ["latitude", "longitude"] + } + }, + "required": ["userId", "numPeople", "location"] + } +