kensho-kfinance 3.1.0__py3-none-any.whl → 3.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of kensho-kfinance might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kensho-kfinance
3
- Version: 3.1.0
3
+ Version: 3.1.1
4
4
  Summary: Python CLI for kFinance
5
5
  Author-email: Luke Brown <luke.brown@kensho.com>, Michelle Keoy <michelle.keoy@kensho.com>, Keith Page <keith.page@kensho.com>, Matthew Rosen <matthew.rosen@kensho.com>, Nick Roshdieh <nick.roshdieh@kensho.com>
6
6
  Project-URL: source, https://github.com/kensho-technologies/kfinance
@@ -1,11 +1,11 @@
1
- kensho_kfinance-3.1.0.dist-info/licenses/AUTHORS.md,sha256=0h9ClbI0pu1oKj1M28ROUsaxrbZg-6ukQGl6X4y9noI,68
2
- kensho_kfinance-3.1.0.dist-info/licenses/LICENSE,sha256=bsY4blvSgq6o0FMQ3RXa2NCgco--nHCCchLXzxr6kms,83
3
- kfinance/CHANGELOG.md,sha256=HFCQeAbfhuhQ-Yhj9gPjNezoYJMs_dvfjjs6hhzv9RE,2576
1
+ kensho_kfinance-3.1.1.dist-info/licenses/AUTHORS.md,sha256=0h9ClbI0pu1oKj1M28ROUsaxrbZg-6ukQGl6X4y9noI,68
2
+ kensho_kfinance-3.1.1.dist-info/licenses/LICENSE,sha256=bsY4blvSgq6o0FMQ3RXa2NCgco--nHCCchLXzxr6kms,83
3
+ kfinance/CHANGELOG.md,sha256=sfJTknzePXjIyK7LUJl-AJ7guMfnz0FSoaSa4alTHdM,2615
4
4
  kfinance/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
5
5
  kfinance/conftest.py,sha256=O9e1ddyTfqnZ1T-9ehnkXwK8PfxPdCHAI7-fke52Ouk,3281
6
6
  kfinance/mcp.py,sha256=LTzCIlqsDKRD-0Xcpa_P99-JmJ8duAneO_-GzM43kjw,424
7
7
  kfinance/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- kfinance/version.py,sha256=KrVRMDzlLQ07c4N1d6-nDOLo4hWpD8cSSFcYXWlm64k,511
8
+ kfinance/version.py,sha256=gpKkyXdaoGFVVAd347dQYBpPSrLX8f2u6UIQ2Q0dcKI,704
9
9
  kfinance/client/README.md,sha256=DA5vg4uz1JmJNiqvYywrj46YNhOr584WO8L83Ysx_Mk,372
10
10
  kfinance/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  kfinance/client/batch_request_handling.py,sha256=opwJJAU2JtqH-s4vt8wRqhH34MiU4tQP6Ng7K6b3upA,6561
@@ -95,7 +95,7 @@ kfinance/integrations/tests/test_example_notebook.py,sha256=NrqYFn_XyOn0YlV9QYEn
95
95
  kfinance/integrations/tool_calling/README.md,sha256=TSk-AJddoEctzc0HXQvGNac2CckbnWxHcRDtEifSe1w,2029
96
96
  kfinance/integrations/tool_calling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
97
97
  kfinance/integrations/tool_calling/all_tools.py,sha256=MbvAZX2yEyovGtBNcr5f6n2G_lV5Zc9nnSn7xgH3zjQ,2115
98
- kfinance/integrations/tool_calling/prompts.py,sha256=cLslVoubJyuh4W2-Eeok2dLOV4R7wUQGCu1HeQ1kNQo,1005
98
+ kfinance/integrations/tool_calling/prompts.py,sha256=4qeW_VLLcxutUFuXnMKa0QD-_jq9qufo03BY-Slz-XU,1718
99
99
  kfinance/integrations/tool_calling/tool_calling_models.py,sha256=o1LGGwx8ikwEiZaHEALS4rvymF9O1Mp5dO9LcfFheUI,5856
100
100
  kfinance/integrations/tool_calling/static_tools/README.md,sha256=lWQWdLY1tkGxqE8o4f61gc-RCX0doaCnZM0GmcNO6Jo,97
101
101
  kfinance/integrations/tool_calling/static_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -107,7 +107,7 @@ kfinance/integrations/tool_calling/static_tools/tests/test_get_n_quarters_ago.py
107
107
  kfinance/integrations/tool_calling/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
108
108
  kfinance/integrations/tool_calling/tests/test_tool_calling_models.py,sha256=Ts1pvaYjq9BTR71dMZ73X__bQ7gQynPkQjy-9x2CuyQ,2605
109
109
  kfinance/models/permission_models.py,sha256=G0so8ZOsD1YDsCM4he0z5R9M_shUbSRwD3hUDJdqZl0,635
110
- kensho_kfinance-3.1.0.dist-info/METADATA,sha256=7xNJrtPsw2Z745G3XYikUwicoR7Iq8fmHEof3Wq0t_0,6202
111
- kensho_kfinance-3.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
112
- kensho_kfinance-3.1.0.dist-info/top_level.txt,sha256=kT_kNwVhfQoOAecY8W7uYah5xaHMoHoAdBIvXh6DaKM,9
113
- kensho_kfinance-3.1.0.dist-info/RECORD,,
110
+ kensho_kfinance-3.1.1.dist-info/METADATA,sha256=ojPqx0wGi-Z6plHIgk1nYET2yDrv8BYv35tjZQIrMfc,6202
111
+ kensho_kfinance-3.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
112
+ kensho_kfinance-3.1.1.dist-info/top_level.txt,sha256=kT_kNwVhfQoOAecY8W7uYah5xaHMoHoAdBIvXh6DaKM,9
113
+ kensho_kfinance-3.1.1.dist-info/RECORD,,
kfinance/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## v3.1.1
4
+ - Update client base prompt
5
+
3
6
  ## v3.1.0
4
7
  - Use unified endpoint for company resolution
5
8
 
@@ -1,17 +1,24 @@
1
- from kfinance.domains.line_items.line_item_tools import GetFinancialLineItemFromIdentifiers
2
- from kfinance.integrations.tool_calling.static_tools.get_latest import GetLatest
1
+ BASE_PROMPT = f"""
2
+ You are an LLM designed to help financial analysts. Use the supplied tools to assist the user.
3
+ CRITICAL RULES FOR TOOL USAGE
3
4
 
5
+ Time Handling:
6
+ - Always select the most recent complete period when the user does not specify a time.
7
+ - Use the get_latest function to determine the latest annual year, latest completed quarter, and current date.
8
+ - For annual data, use the latest completed year. For quarterly data, use the latest completed quarter and year.
9
+ - If the user specifies a time period (year, quarter, or date range), use it exactly as provided.
10
+ - For relative time references (such as "3 quarters ago"), always use get_n_quarters_ago to resolve the correct year and quarter.
11
+ - For price or history tools, if the user does not specify a date range, use the most recent period as determined by get_latest.
12
+ - "Last year" or "last quarter" refers to the previous completed period from the current date.
13
+ - For quarterly data requests without specific quarters, assume the most recent completed quarter.
4
14
 
5
- BASE_PROMPT = f"""
6
- You are an agent that calls one or more tools to retrieve data to answer questions from
7
- financial analysts. Use the supplied tools to answer the user's questions.
15
+ Tool Selection:
16
+ - Use get_latest before any other tool when dates are ambiguous, unspecified, or when you need to determine the most recent period.
17
+ - Use get_n_quarters_ago for relative quarter references such as "3 quarters ago".
18
+ - Always make tool calls when financial data is requested—never skip them.
19
+ - For identifier resolution, use the exact identifiers provided by the user. Do not add or modify suffixes unless explicitly required.
8
20
 
9
- - Always use the `{GetLatest.model_fields["name"].default}` function when asked about the last or most recent quarter or
10
- when the time is unspecified in the question.
11
- - Try to use `{GetFinancialLineItemFromIdentifiers.model_fields["name"].default}` for questions about a company's
12
- finances.
13
- - If the tools do not respond with data that answers the question, then respond by saying that
14
- you don't have the data available.
15
- - Keep calling tools until you have the answer or the tool says the data is not available.
16
- - Label large numbers with "million" or "billion" and currency symbols if appropriate.
17
- """
21
+ Identifier Handling:
22
+ - Use the exact identifiers provided by the user. Do not add or modify suffixes such as ".PA" or ".DE" unless the user specifies the exchange or market.
23
+ - Never invent or guess identifiers. Only use those explicitly provided.
24
+ """
kfinance/version.py CHANGED
@@ -1,7 +1,14 @@
1
1
  # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
3
 
4
- __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
4
+ __all__ = [
5
+ "__version__",
6
+ "__version_tuple__",
7
+ "version",
8
+ "version_tuple",
9
+ "__commit_id__",
10
+ "commit_id",
11
+ ]
5
12
 
6
13
  TYPE_CHECKING = False
7
14
  if TYPE_CHECKING:
@@ -9,13 +16,19 @@ if TYPE_CHECKING:
9
16
  from typing import Union
10
17
 
11
18
  VERSION_TUPLE = Tuple[Union[int, str], ...]
19
+ COMMIT_ID = Union[str, None]
12
20
  else:
13
21
  VERSION_TUPLE = object
22
+ COMMIT_ID = object
14
23
 
15
24
  version: str
16
25
  __version__: str
17
26
  __version_tuple__: VERSION_TUPLE
18
27
  version_tuple: VERSION_TUPLE
28
+ commit_id: COMMIT_ID
29
+ __commit_id__: COMMIT_ID
19
30
 
20
- __version__ = version = '3.1.0'
21
- __version_tuple__ = version_tuple = (3, 1, 0)
31
+ __version__ = version = '3.1.1'
32
+ __version_tuple__ = version_tuple = (3, 1, 1)
33
+
34
+ __commit_id__ = commit_id = None