nvidia-nat-llama-index 1.3.0a20251013__py3-none-any.whl → 1.3.0a20251022__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.
@@ -44,8 +44,16 @@ def _patch_llm_based_on_config(client: ModelType, llm_config: LLMBaseConfig) ->
44
44
 
45
45
  @override
46
46
  def inject(self, messages: Sequence[ChatMessage], *args, **kwargs) -> FunctionArgumentWrapper:
47
- new_messages = [ChatMessage(role="system", content=self.system_prompt)] + list(messages)
48
- return FunctionArgumentWrapper(new_messages, *args, **kwargs)
47
+ for i, message in enumerate(messages):
48
+ if message.role == "system":
49
+ if self.system_prompt not in str(message.content):
50
+ messages = list(messages)
51
+ messages[i] = ChatMessage(role="system", content=f"{message.content}\n{self.system_prompt}")
52
+ break
53
+ else:
54
+ messages = list(messages)
55
+ messages.insert(0, ChatMessage(role="system", content=self.system_prompt))
56
+ return FunctionArgumentWrapper(messages, *args, **kwargs)
49
57
 
50
58
  if isinstance(llm_config, RetryMixin):
51
59
  client = patch_with_retry(client,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nvidia-nat-llama-index
3
- Version: 1.3.0a20251013
3
+ Version: 1.3.0a20251022
4
4
  Summary: Subpackage for Llama-Index integration in NeMo Agent toolkit
5
5
  Author: NVIDIA Corporation
6
6
  Maintainer: NVIDIA Corporation
@@ -16,7 +16,7 @@ Requires-Python: <3.14,>=3.11
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE-3rd-party.txt
18
18
  License-File: LICENSE.md
19
- Requires-Dist: nvidia-nat==v1.3.0a20251013
19
+ Requires-Dist: nvidia-nat==v1.3.0a20251022
20
20
  Requires-Dist: llama-index-core~=0.12.21
21
21
  Requires-Dist: llama-index-embeddings-azure-openai~=0.3.9
22
22
  Requires-Dist: llama-index-embeddings-nvidia~=0.3.1
@@ -1,13 +1,13 @@
1
1
  nat/meta/pypi.md,sha256=s9C3pgWB0HLIXTx5QPryNOWN0O2fIRIap0p9_zCHlTs,1112
2
2
  nat/plugins/llama_index/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  nat/plugins/llama_index/embedder.py,sha256=4c4uAa19UArqA_Npe5mwEnUhCaguTbyWcAntBzcPEeQ,3493
4
- nat/plugins/llama_index/llm.py,sha256=ms6qwcBISWhiiOhIUXFNuhpDenTIS5s7U47wB3fEgg0,4944
4
+ nat/plugins/llama_index/llm.py,sha256=7fneFsjXjZJ-ReLAy1aUslkGhj6_fG_gFbyy4ME-QH4,5350
5
5
  nat/plugins/llama_index/register.py,sha256=1x_b8u6cuQwh4Iz_7TcIFWXvLIL9IIKUPE-zR9d6ug8,859
6
6
  nat/plugins/llama_index/tool_wrapper.py,sha256=VFKMIIeLdWqHwW2Ax11E2w-_9w3ow6Iuhra1Hk78RYM,1387
7
- nvidia_nat_llama_index-1.3.0a20251013.dist-info/licenses/LICENSE-3rd-party.txt,sha256=fOk5jMmCX9YoKWyYzTtfgl-SUy477audFC5hNY4oP7Q,284609
8
- nvidia_nat_llama_index-1.3.0a20251013.dist-info/licenses/LICENSE.md,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
9
- nvidia_nat_llama_index-1.3.0a20251013.dist-info/METADATA,sha256=pohFCz4mmX2y4bySRuFCl9bVHc3COSkJPsVPnGVPHxM,2422
10
- nvidia_nat_llama_index-1.3.0a20251013.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
- nvidia_nat_llama_index-1.3.0a20251013.dist-info/entry_points.txt,sha256=2LqRRju5448P2v8B3y6TSPnk-nOd5T3AmV5JibCnoQc,68
12
- nvidia_nat_llama_index-1.3.0a20251013.dist-info/top_level.txt,sha256=8-CJ2cP6-f0ZReXe5Hzqp-5pvzzHz-5Ds5H2bGqh1-U,4
13
- nvidia_nat_llama_index-1.3.0a20251013.dist-info/RECORD,,
7
+ nvidia_nat_llama_index-1.3.0a20251022.dist-info/licenses/LICENSE-3rd-party.txt,sha256=fOk5jMmCX9YoKWyYzTtfgl-SUy477audFC5hNY4oP7Q,284609
8
+ nvidia_nat_llama_index-1.3.0a20251022.dist-info/licenses/LICENSE.md,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
9
+ nvidia_nat_llama_index-1.3.0a20251022.dist-info/METADATA,sha256=EKoMndplU8hJYQj24_hSC-UgfEbhRQquN5iCmkhfskE,2422
10
+ nvidia_nat_llama_index-1.3.0a20251022.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
+ nvidia_nat_llama_index-1.3.0a20251022.dist-info/entry_points.txt,sha256=2LqRRju5448P2v8B3y6TSPnk-nOd5T3AmV5JibCnoQc,68
12
+ nvidia_nat_llama_index-1.3.0a20251022.dist-info/top_level.txt,sha256=8-CJ2cP6-f0ZReXe5Hzqp-5pvzzHz-5Ds5H2bGqh1-U,4
13
+ nvidia_nat_llama_index-1.3.0a20251022.dist-info/RECORD,,