python-fastllm 0.0.39__tar.gz → 0.0.40__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.
Files changed (28) hide show
  1. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/PKG-INFO +2 -2
  2. python_fastllm-0.0.40/fastllm/__init__.py +1 -0
  3. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/fastllm/gemini.py +1 -1
  4. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/fastllm/streaming.py +4 -2
  5. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/fastllm/types.py +1 -1
  6. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/pyproject.toml +1 -1
  7. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/python_fastllm.egg-info/PKG-INFO +2 -2
  8. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/python_fastllm.egg-info/requires.txt +1 -1
  9. python_fastllm-0.0.39/fastllm/__init__.py +0 -1
  10. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/README.md +0 -0
  11. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/fastllm/_modidx.py +0 -0
  12. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/fastllm/acomplete.py +0 -0
  13. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/fastllm/anthropic.py +0 -0
  14. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/fastllm/chat.py +0 -0
  15. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/fastllm/codex.py +0 -0
  16. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/fastllm/openai_chat.py +0 -0
  17. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/fastllm/openai_responses.py +0 -0
  18. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/fastllm/specs/anthropic.json +0 -0
  19. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/fastllm/specs/anthropic.yml +0 -0
  20. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/fastllm/specs/gemini.json +0 -0
  21. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/fastllm/specs/openai.with-code-samples.json +0 -0
  22. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/fastllm/specs/openai.with-code-samples.yml +0 -0
  23. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/fastllm/specs/spec_manifest.json +0 -0
  24. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/python_fastllm.egg-info/SOURCES.txt +0 -0
  25. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/python_fastllm.egg-info/dependency_links.txt +0 -0
  26. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/python_fastllm.egg-info/entry_points.txt +0 -0
  27. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/python_fastllm.egg-info/top_level.txt +0 -0
  28. {python_fastllm-0.0.39 → python_fastllm-0.0.40}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-fastllm
3
- Version: 0.0.39
3
+ Version: 0.0.40
4
4
  Author-email: Kerem Turgutlu <keremturgutlu@gmail.com>
5
5
  License: Apache-2.0
6
6
  Project-URL: Repository, https://github.com/AnswerDotAI/fastllm
@@ -11,7 +11,7 @@ Requires-Python: >=3.10
11
11
  Description-Content-Type: text/markdown
12
12
  Requires-Dist: fastcore>=2.1.18
13
13
  Requires-Dist: aidialog>=0.0.10
14
- Requires-Dist: fastspec>=0.0.11
14
+ Requires-Dist: fastspec>=0.2.0
15
15
  Requires-Dist: pillow
16
16
 
17
17
  # fastllm
@@ -0,0 +1 @@
1
+ __version__ = "0.0.40"
@@ -259,7 +259,7 @@ def mk_payload(msgs, model, **kwargs):
259
259
  has_srv = any(k in t for t in gem_tools for k in ('googleSearch','codeExecution','googleSearchRetrieval'))
260
260
  if has_fn and has_srv: payload.setdefault('tool_config', {})['includeServerSideToolInvocations'] = True
261
261
  if tchc:=denorm_tool_choice(kwargs.get('tool_choice')): payload.setdefault('tool_config', {}).update(tchc)
262
- if kwargs.get('stream'): payload.update(stream=True, _query={"alt": "sse"})
262
+ if kwargs.get('stream'): payload.update(stream=True, query_={"alt": "sse"})
263
263
  return payload
264
264
 
265
265
  # %% ../nbs/05_gemini.ipynb #60d52c1f
@@ -19,8 +19,10 @@ class Delta(BasicRepr):
19
19
  "Normalized streaming delta event."
20
20
  def __init__(self, text='', thinking='', refusal='', tool_calls=None, citations=None,
21
21
  server_tool_result=None, finish_reason=None, usage=None, raw=None):
22
+ if tool_calls is None: tool_calls = []
23
+ if citations is None: citations = []
24
+ if raw is None: raw = {}
22
25
  store_attr()
23
- self.tool_calls,self.citations,self.raw = ifnone(tool_calls,[]),ifnone(citations,[]),ifnone(raw,{})
24
26
  def __eq__(self, o): return type(o) is type(self) and self.__dict__ == o.__dict__
25
27
  def __hash__(self): return hash((self.text, self.thinking, self.finish_reason))
26
28
 
@@ -45,8 +47,8 @@ class PrintStream:
45
47
  class PartAccum(BasicRepr):
46
48
  "Accumulate streamed part deltas by index"
47
49
  def __init__(self, parts=None):
50
+ if parts is None: parts = {}
48
51
  store_attr()
49
- self.parts = ifnone(parts, {})
50
52
  def __eq__(self, o): return type(o) is type(self) and self.__dict__ == o.__dict__
51
53
  def __hash__(self): return hash(len(self.parts))
52
54
 
@@ -25,8 +25,8 @@ class Usage(BasicRepr):
25
25
  "Normalized usage."
26
26
  def __init__(self, prompt_tokens=0, completion_tokens=0, total_tokens=0, cached_tokens=0,
27
27
  cache_creation_tokens=0, reasoning_tokens=0, raw=None):
28
+ if raw is None: raw = {}
28
29
  store_attr()
29
- self.raw = ifnone(raw, {})
30
30
  def __eq__(self, o): return type(o) is type(self) and self.__dict__ == o.__dict__
31
31
 
32
32
 
@@ -15,7 +15,7 @@ classifiers = [
15
15
  "Programming Language :: Python :: 3",
16
16
  "Programming Language :: Python :: 3 :: Only",
17
17
  ]
18
- dependencies = ['fastcore>=2.1.18', 'aidialog>=0.0.10', 'fastspec>=0.0.11', 'pillow']
18
+ dependencies = ['fastcore>=2.1.18', 'aidialog>=0.0.10', 'fastspec>=0.2.0', 'pillow']
19
19
 
20
20
  [project.urls]
21
21
  Repository = "https://github.com/AnswerDotAI/fastllm"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-fastllm
3
- Version: 0.0.39
3
+ Version: 0.0.40
4
4
  Author-email: Kerem Turgutlu <keremturgutlu@gmail.com>
5
5
  License: Apache-2.0
6
6
  Project-URL: Repository, https://github.com/AnswerDotAI/fastllm
@@ -11,7 +11,7 @@ Requires-Python: >=3.10
11
11
  Description-Content-Type: text/markdown
12
12
  Requires-Dist: fastcore>=2.1.18
13
13
  Requires-Dist: aidialog>=0.0.10
14
- Requires-Dist: fastspec>=0.0.11
14
+ Requires-Dist: fastspec>=0.2.0
15
15
  Requires-Dist: pillow
16
16
 
17
17
  # fastllm
@@ -1,4 +1,4 @@
1
1
  fastcore>=2.1.18
2
2
  aidialog>=0.0.10
3
- fastspec>=0.0.11
3
+ fastspec>=0.2.0
4
4
  pillow
@@ -1 +0,0 @@
1
- __version__ = "0.0.39"