toolslm 0.3.22__tar.gz → 0.3.24__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: toolslm
3
- Version: 0.3.22
3
+ Version: 0.3.24
4
4
  Summary: Tools to make language models a bit easier to use
5
5
  Home-page: https://github.com/AnswerDotAI/toolslm
6
6
  Author: Jeremy Howard
@@ -1,7 +1,7 @@
1
1
  [DEFAULT]
2
2
  repo = toolslm
3
3
  lib_name = toolslm
4
- version = 0.3.22
4
+ version = 0.3.24
5
5
  min_python = 3.9
6
6
  license = apache2
7
7
  black_formatting = False
@@ -0,0 +1 @@
1
+ __version__ = "0.3.24"
@@ -70,7 +70,7 @@ def _handle_type(t, defs):
70
70
  def _is_container(t):
71
71
  "Check if type is a container (list, dict, tuple, set, Union)"
72
72
  origin = get_origin(t)
73
- return origin in (list, dict, tuple, set, Union) if origin else False
73
+ return origin in (list, dict, tuple, set, Union, UnionType) if origin else False
74
74
 
75
75
  def _is_parameterized(t):
76
76
  "Check if type has arguments (e.g. list[int] vs list, dict[str, int] vs dict)"
@@ -144,7 +144,7 @@ def get_schema(
144
144
  has_type = (ret.anno is not empty) and (ret.anno is not None)
145
145
  has_doc = ret.docment
146
146
  if has_type or has_doc:
147
- type_str = f'type: {_types(ret.anno)[0]}'
147
+ type_str = f'type: {_types(ret.anno)[0]}' if has_type else None
148
148
  ret_str = f'{ret.docment} ({type_str})' if has_type and has_doc else (type_str if has_type else ret.docment)
149
149
  desc += f'\n\nReturns:\n- {ret_str}'
150
150
  return {"name": f.__name__, "description": desc, pname: schema}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: toolslm
3
- Version: 0.3.22
3
+ Version: 0.3.24
4
4
  Summary: Tools to make language models a bit easier to use
5
5
  Home-page: https://github.com/AnswerDotAI/toolslm
6
6
  Author: Jeremy Howard
@@ -1 +0,0 @@
1
- __version__ = "0.3.22"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes