File size: 652 Bytes
d9a6ba1
d4223b0
d9a6ba1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from typing import Optional
from .engineconomics import time_value
from langchain.tools import tool

tv = time_value()

# Define your tool function
@tool
def time_value_tool(CF: float, F: str, i: float, n: float, g: Optional[float] = None) -> float:
    """
    Computes time value of money factors using standard financial formulas.

    Parameters:
    CF (float): Assessed cash flow
    F (str): Factor type (e.g., "P/F", "F/A", "P/G", "P/g")
    i (float): Effective interest rate
    n (float): Term in periods
    g (float): Geometric gradient (optional)

    Returns:
    dictionary
    """
    output = tv.cfv(CF, F, i, n, g)

    return output