File size: 820 Bytes
05e6f93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from abc import ABC, abstractmethod
import json


class ModelInference(ABC):
    @abstractmethod
    def inference(self, input_data, mode=None):
        """This method should be implemented by subclasses."""
        pass

    def get_simple_json(self):
        # Define a simple data structure
        data = {
          "table": [
                {
                  "description": "Revenues",
                  "latest_amount": 12453,
                  "previous_amount": 11445
                },
                {
                  "description": "Operating expenses",
                  "latest_amount": 9157,
                  "previous_amount": 8822
                }
            ]
        }

        # Convert the dictionary to a JSON string
        json_data = json.dumps(data, indent=4)
        return json_data