{
  "source_file": "server/server.py",
  "generated_at": "2026-01-10T21:27:26.153121",
  "summary": {
    "purpose": "This file is a Flask web application server for a data recommendation system, handling API requests and interactions with various services like OpenAI and ElevenLabs.",
    "exports": [
      "after_request",
      "extract_info",
      "has_none",
      "merge_info",
      "get_question",
      "generate_results",
      "text_to_speech_api",
      "reset",
      "initialize",
      "get_messages"
    ],
    "imports": [
      "Flask",
      "request",
      "jsonify",
      "send_file",
      "CORS",
      "io",
      "typing",
      "BaseModel",
      "OpenAIClient",
      "Agent",
      "Memory",
      "TextBlock",
      "tool",
      "ElevenLabs",
      "ast",
      "recommend_universities"
    ],
    "key_components": [
      {
        "name": "after_request",
        "type": "function",
        "description": "A decorator function that adds CORS headers to the response."
      },
      {
        "name": "Info",
        "type": "class",
        "description": "A Pydantic model class representing student data, including fields for academic profile, aspiration values, lifestyle preferences, budget, and more."
      },
      {
        "name": "Message",
        "type": "class",
        "description": "A Pydantic model class representing a message in the message history for the sidebar, including an ID, text, and sender."
      }
    ],
    "data_structures": "Info, Message",
    "algorithms": "None explicitly defined, but the system uses OpenAI and ElevenLabs APIs for text generation and speech synthesis.",
    "configuration": "The OpenAI and ElevenLabs API keys are set in the code, and the application uses shared memory for persistent data storage.",
    "notes": "The application handles various functionalities such as getting a list of universities, extracting information from text, merging information, generating questions, generating results, and handling speech-to-text API calls."
  }
}