{"id":25662613,"url":"https://github.com/hopeforgedev/visa-assistant","last_synced_at":"2025-09-11T16:49:31.689Z","repository":{"id":278631036,"uuid":"936262990","full_name":"HopeforgeDev/Visa-Assistant","owner":"HopeforgeDev","description":"Visa Assistant developed by OpenAI Text Generation and Function Calling","archived":false,"fork":false,"pushed_at":"2025-02-25T19:43:42.000Z","size":397,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-30T17:43:30.083Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HopeforgeDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-20T19:44:20.000Z","updated_at":"2025-02-25T19:43:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"496a9d9a-675b-470e-b58a-18f9798d8dd9","html_url":"https://github.com/HopeforgeDev/Visa-Assistant","commit_stats":null,"previous_names":["hopeforgedev/visa-assistant"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HopeforgeDev/Visa-Assistant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HopeforgeDev%2FVisa-Assistant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HopeforgeDev%2FVisa-Assistant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HopeforgeDev%2FVisa-Assistant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HopeforgeDev%2FVisa-Assistant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HopeforgeDev","download_url":"https://codeload.github.com/HopeforgeDev/Visa-Assistant/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HopeforgeDev%2FVisa-Assistant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274672906,"owners_count":25328550,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-24T04:28:29.533Z","updated_at":"2025-09-11T16:49:31.680Z","avatar_url":"https://github.com/HopeforgeDev.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI Visa Assistant 🛂\n\nAn AI-powered solution to determine visa requirements between countries using OpenAI's GPT models and function calling.\n\n## Project Objective 🎯\n**Primary Goal:** Determine visa type and maximum stay duration for a given passport nationality and destination country based on provided visa rules data.\n\n**Key Features:**\n- Visa requirement analysis using OpenAI GPT-4/GPT-4o-mini\n- Text and image input support for passport information\n- Structured conversation flow matching real consular interactions\n- Strict validation against provided JSON data schema\n\n## Prerequisites 📋\n- Python 3.9+\n- Jupyter Notebook\n- OpenAI API key (provided separately)\n- Basic understanding of ISO country codes (3-letter format)\n\n## Setup Instructions ⚙️\n\n### 1. Environment Setup\n```bash\n# Clone repository\ngit clone https://github.com/HopeforgeDev/Visa-Assistant.git\ncd Visa-Assistant\n\n# Install dependencies\npip install openai ipywidgets pillow python-dotenv\n\njupyter nbextension enable --py widgetsnbextension\n\n# For JupyterLab users\njupyter labextension install @jupyter-widgets/jupyterlab-manager\n```\n\n### 2. Configuration\n1. Create `.env` file:\n```bash\necho \"OPENAI_API_KEY=your_api_key_here\" \u003e .env\n```\n\n2. Place these files in project root:\n- `visa_information.json` (provided dataset)\n- `specimen-passports/` directory (for image upload testing)\n\n### 3. Data Structure Validation\nEnsure your `visa_information.json` follows this structure:\n```json\n{\n  \"PRT\": {\n    \"visaFree\": {\n      \"SGP\": {\"maxStay\": 30}\n    },\n    \"visaOnArrival\": {\n      \"CYP\": {\"maxStay\": 90}\n    }\n  }\n}\n```\n\n## Usage Instructions 💻\n\n### Basic Text-Based Flow\n1. Start Jupyter Notebook:\n```bash\njupyter notebook\n```\n\n2. Open `visa_assistant.ipynb`\n\n3. Follow prompts:\n```text\nAI: Welcome to Visa Assistant! How can I help today?\nUser: I'm planning a trip to Portugal\nAI: Could you please specify your passport issuer?\nUser: Lebanon\nAI: Lebanese passport holders need to apply for a visa...\n```\n\n### Image Upload Flow (Bonus)\n1. In the notebook interface:\n```text\n...\nAI: Thank you. Could you specify your passport nationality?\nUser: upload  # Type exactly this and press Enter\nAI: Press Enter after uploading...  # Hit Enter in the notebook input field\n[Presses Enter]\nAI: Detected passport code: SGP\nAI: Singaporean passport holders are exempt...\n\n```\n\n2. Supported passport images:\n- Machine-readable zone (bottom of passport page)\n- Clear country code visibility\n\n## Project Structure 📂\n```\nvisa-assistant/\n├── Visa_Assistant.ipynb        # Main notebook\n├── visa_information.json       # Visa rules dataset\n├── .env.example                # Environment template\n├── requirements.txt            # Dependency list\n└── specimen-passports/         # Sample passport images\n    ├── portugal.jpg\n    └── singapore.jpg\n```\n\n## Key Functionality 🔧\n1. **Visa Recommendation Engine**\n```python\ndef get_visa_recommendation(passport_code, destination_code):\n    # Returns formatted recommendation based on exact JSON data\n```\n\n3. **Conversation Manager**\n```python\ndef visa_chat():\n    # Manages state: Destination -\u003e Passport -\u003e Result\n    # Implements exact sample dialogue patterns\n```\n\n## Testing Scenarios 🧪\n| Test Case | Input | Expected Output |\n|-----------|-------|-----------------|\n| Lebanese → Portugal | LBN/PRT | Apply offline |\n| Singaporean → Portugal | SGP/PRT | Visa exempt 30 days |\n| Cypriot → Portugal | CYP/PRT | Visa on arrival 90 days |\n| Image Upload Test | passport.jpg | Detected country code |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhopeforgedev%2Fvisa-assistant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhopeforgedev%2Fvisa-assistant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhopeforgedev%2Fvisa-assistant/lists"}