Update api.py
Browse files
api.py
CHANGED
@@ -60,6 +60,18 @@ class ProblemDescriptionRequest(BaseModel):
|
|
60 |
class ProblemDescriptionResponse(BaseModel):
|
61 |
problem_description: str
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
# --- Global Variables / State ---
|
64 |
# Keep the graph instance global for efficiency if desired,
|
65 |
# but consider potential concurrency issues if graph/LLMs have state.
|
@@ -393,6 +405,19 @@ async def gen_problem_description(request: ProblemDescriptionRequest):
|
|
393 |
# Alternative: Return as plain text
|
394 |
# return PlainTextResponse(content=result_text)
|
395 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
396 |
# --- How to Run ---
|
397 |
if __name__ == "__main__":
|
398 |
# Make sure to set environment variables for config (NEO4J_URI, NEO4J_PASSWORD, GEMINI_API_KEY, etc.)
|
|
|
60 |
class ProblemDescriptionResponse(BaseModel):
|
61 |
problem_description: str
|
62 |
|
63 |
+
# Format KI
|
64 |
+
|
65 |
+
class FormattedKeyIssue(BaseModel):
|
66 |
+
id: int
|
67 |
+
title: str
|
68 |
+
description: str
|
69 |
+
challenges: List[str]
|
70 |
+
potential_impact: str = Field(..., alias="potential_impact") # alias can be useful if field names differ
|
71 |
+
|
72 |
+
class KeyIssueFormatResponse(BaseModel):
|
73 |
+
key_issues: List[FormattedKeyIssue]
|
74 |
+
|
75 |
# --- Global Variables / State ---
|
76 |
# Keep the graph instance global for efficiency if desired,
|
77 |
# but consider potential concurrency issues if graph/LLMs have state.
|
|
|
405 |
# Alternative: Return as plain text
|
406 |
# return PlainTextResponse(content=result_text)
|
407 |
|
408 |
+
@app.post("/key-issue-format", response_model=KeyIssueFormatResponse)
|
409 |
+
async def return_key_issue():
|
410 |
+
"""
|
411 |
+
Returns a hardcoded example of formatted key issues.
|
412 |
+
This endpoint does not accept any input body.
|
413 |
+
"""
|
414 |
+
logger.info("Received request for hardcoded key issue format.")
|
415 |
+
# Hardcoded result data
|
416 |
+
result = {'key_issues': [{'id': 1, 'title': 'MCX Priority Handling Conflict: AF vs. Subscription Data', 'description': 'Conflicting prioritization between Application Function (AF) requests and subscription data for Mission Critical Services (MCX) needs resolution. Allowing AFs to override subscription priorities raises security concerns and requires robust error handling. Consistent enforcement across the 5GC is crucial.', 'challenges': ['Guaranteeing precedence of dynamic AF requests over subscription data.', 'Addressing security implications of AF-based priority overrides.', 'Defining detailed error handling for unfulfilled AF priority requests.'], 'potential_impact': 'Unreliable MCX service prioritization and potential security vulnerabilities.'}, {'id': 2, 'title': 'ATSSS Complexity and Interoperability Across 5GC and EPC', 'description': 'Access Traffic Steering, Switching, and Splitting (ATSSS) introduces complexity, especially with EPC interworking. The optional nature of ATSSS raises interoperability concerns and requires clear fallback mechanisms. Consistent steering mode handling across 3GPP and non-3GPP access networks is essential.', 'challenges': ['Managing mobility, security, and charging in ATSSS interworking scenarios.', 'Defining fallback mechanisms for non-ATSSS capable UEs and networks.', 'Ensuring consistent steering mode handling across different access networks.'], 'potential_impact': 'Interoperability issues and inconsistent ATSSS behavior.'}, {'id': 3, 'title': 'PCF Scalability and Performance with MCX and ATSSS', 'description': 'The Policy Control Function (PCF) plays a central role in MCX and ATSSS, handling subscription data changes, dynamic AF requests, and ATSSS control. This raises concerns about PCF scalability and performance, especially with a high volume of users and services. The complexity of PCC rules impacts PCF processing time.', 'challenges': ['Handling subscription data changes and dynamic AF requests efficiently.', 'Optimizing PCF performance with complex PCC rules for MCX and ATSSS.', 'Ensuring PCF scalability to support a large number of users and services.'], 'potential_impact': 'PCF bottlenecks and degraded network performance.'}, {'id': 4, 'title': 'Policy Conflict Resolution During Network Slice Replacement', 'description': "Prioritizing the replaced S-NSSAI's policy during network slice replacement might negate benefits of the alternative slice. There is a need for more granularity in how the PCF combines policies, especially when policy parameters are contradictory. Need to evaluate when the alternative S-NSSAI policy should take precedence.", 'challenges': ['Developing sophisticated policy conflict resolution mechanisms.', 'Handling contradictory policy parameters during slice replacement.', 'Determining when alternative slice policy should override replaced slice policy.'], 'potential_impact': 'Suboptimal performance or negated benefits of the alternative network slice.'}, {'id': 5, 'title': 'SMF Decision Logic for Retaining PDU Sessions During Slice Replacement', 'description': "The SMF's criteria for retaining existing PDU Sessions during slice replacement are vague and need more precise definition. Lack of clear guidelines could lead to inconsistent behavior across different implementations. Need to define other factors influencing this decision to avoid suboptimal routing.", 'challenges': ['Defining clear criteria for SMF decision-making on PDU session retention.', "Handling scenarios where PCF can be reused but shouldn't be.", 'Ensuring consistent behavior across different SMF implementations.'], 'potential_impact': 'Inconsistent routing and unnecessary session re-establishment.'}, {'id': 6, 'title': 'Privacy in Multi-hop Network Slicing with SPNS Protocol', 'description': 'Protecting user privacy in multi-hop network slice deployments presents a challenge. Secure Slice Selection and RAN Authentication and Trust are areas that require standardization. Onion Routing integration needs to be defined to work with existing 3GPP protocols.', 'challenges': ['Defining mechanisms to protect user privacy across multiple RAN nodes.', 'Controlling visibility of slice identifiers and policies to RAN nodes.', 'Establishing trust between different RAN nodes participating in the same slice.', 'Integrating onion routing with existing 3GPP protocols.'], 'potential_impact': 'Potential privacy breaches and security vulnerabilities in multi-hop network slice deployments.'}, {'id': 7, 'title': 'Multi-Tenancy Security and Network Slice Isolation', 'description': "Multi-tenancy introduces significant security concerns in 5G network slicing. Current isolation mechanisms might be insufficient to prevent cross-slice interference or attacks. There is a need to define the terms 'isolation' and 'insulation' and their respective security requirements.", 'challenges': ['Preventing cross-slice interference or attacks in multi-tenant environments.', "Clearly defining 'isolation' and 'insulation' in the context of network slicing.", 'Optimally selecting network slice isolation points based on risk assessment.'], 'potential_impact': 'Security breaches and compromised isolation between network slices.'}, {'id': 8, 'title': 'Adversarial Machine Learning (AML) Attacks on 5G Systems', 'description': 'Adversarial Machine Learning (AML) introduces new security vulnerabilities in 5G systems. AML attacks on spectrum sharing and physical layer authentication have not been adequately considered. Standardizing or recommending AML-robust machine learning models is needed.', 'challenges': ['Standardizing AML-resilient ML models for critical 5G functions.', 'Defining security requirements for ML-enabled network elements.', 'Developing testing and validation frameworks for AML resilience.'], 'potential_impact': 'Compromised security and reliability of 5G networks due to AML attacks.'}, {'id': 9, 'title': 'V2X Application Support with Network Slicing: Information Abstraction', 'description': 'Efficiently presenting/abstracting the relevant network slice information to the V2X application layer needs further study. The V2X application needs to understand the capabilities and limitations of the underlying slice. The information needs to be abstracted efficiently.', 'challenges': ['Determining what network slice information is necessary for V2X applications.', 'Defining how network slice information should be formatted for V2X applications.', 'Enabling V2X applications to understand slice capabilities and limitations.'], 'potential_impact': 'Inefficient use of network slices by V2X applications.'}, {'id': 10, 'title': 'V2X Application Support with Network Slicing: Multi-PLMN Coordination', 'description': 'Supporting V2X applications seamlessly across different Public Land Mobile Networks (PLMNs) and across different network slices is a challenge. Coordination is crucial for consistent performance in roaming and non-roaming scenarios. Roaming needs to be taken into account.', 'challenges': ['Supporting V2X applications across different PLMNs and network slices.', 'Ensuring consistent V2X performance in roaming and non-roaming scenarios.', 'Coordinating network slices across different network operators.'], 'potential_impact': 'Inconsistent V2X performance when vehicles move between different networks.'}]}
|
417 |
+
# FastAPI automatically converts the dictionary to a JSON response
|
418 |
+
# We use the response_model for validation and documentation
|
419 |
+
return result
|
420 |
+
|
421 |
# --- How to Run ---
|
422 |
if __name__ == "__main__":
|
423 |
# Make sure to set environment variables for config (NEO4J_URI, NEO4J_PASSWORD, GEMINI_API_KEY, etc.)
|