agentiq-llama-index 1.0.0rc8__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.
- agentiq_llama_index-1.0.0rc8.dist-info/METADATA +13 -0
- agentiq_llama_index-1.0.0rc8.dist-info/RECORD +9 -0
- agentiq_llama_index-1.0.0rc8.dist-info/WHEEL +5 -0
- agentiq_llama_index-1.0.0rc8.dist-info/entry_points.txt +2 -0
- agentiq_llama_index-1.0.0rc8.dist-info/top_level.txt +1 -0
- aiq/plugins/llama_index/__init__.py +0 -0
- aiq/plugins/llama_index/llm.py +53 -0
- aiq/plugins/llama_index/register.py +23 -0
- aiq/plugins/llama_index/tool_wrapper.py +32 -0
@@ -0,0 +1,13 @@
|
|
1
|
+
Metadata-Version: 2.2
|
2
|
+
Name: agentiq-llama-index
|
3
|
+
Version: 1.0.0rc8
|
4
|
+
Summary: Subpackage for Llama-Index integration in AgentIQ
|
5
|
+
Keywords: ai,rag,agents
|
6
|
+
Classifier: Programming Language :: Python
|
7
|
+
Requires-Python: >=3.12
|
8
|
+
Requires-Dist: agentiq
|
9
|
+
Requires-Dist: llama-index-core==0.12.15
|
10
|
+
Requires-Dist: llama-index-embeddings-nvidia==0.3.1
|
11
|
+
Requires-Dist: llama-index-llms-nvidia==0.3.1
|
12
|
+
Requires-Dist: llama-index-readers-file==0.4.4
|
13
|
+
Requires-Dist: llama-index==0.12.15
|
@@ -0,0 +1,9 @@
|
|
1
|
+
aiq/plugins/llama_index/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
aiq/plugins/llama_index/llm.py,sha256=3F-hNlqgkrTz_yd1WtarRmN1GhcLOTQCizuXGiKbBYw,1848
|
3
|
+
aiq/plugins/llama_index/register.py,sha256=da1IYMrYe4MUtlwzBGIiukPazf7WU40j5X3n2KCjNts,868
|
4
|
+
aiq/plugins/llama_index/tool_wrapper.py,sha256=n7E6uzVtcyFXSWtkYG8yrtqRCsXVHdEU38eTrWLSlrU,1387
|
5
|
+
agentiq_llama_index-1.0.0rc8.dist-info/METADATA,sha256=mQEsBs7coneoi2IVnmYXNWOyx8_7e7m0m-fOZ9ILjZE,461
|
6
|
+
agentiq_llama_index-1.0.0rc8.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
7
|
+
agentiq_llama_index-1.0.0rc8.dist-info/entry_points.txt,sha256=2_FES--T1uOL8QdHJWWhuFipXoSK8uo0DR8olysK2Ck,68
|
8
|
+
agentiq_llama_index-1.0.0rc8.dist-info/top_level.txt,sha256=fo7AzYcNhZ_tRWrhGumtxwnxMew4xrT1iwouDy_f0Kc,4
|
9
|
+
agentiq_llama_index-1.0.0rc8.dist-info/RECORD,,
|
@@ -0,0 +1 @@
|
|
1
|
+
aiq
|
File without changes
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
16
|
+
from aiq.builder.builder import Builder
|
17
|
+
from aiq.builder.framework_enum import LLMFrameworkEnum
|
18
|
+
from aiq.cli.register_workflow import register_llm_client
|
19
|
+
from aiq.llm.nim_llm import NIMModelConfig
|
20
|
+
from aiq.llm.openai_llm import OpenAIModelConfig
|
21
|
+
|
22
|
+
|
23
|
+
@register_llm_client(config_type=NIMModelConfig, wrapper_type=LLMFrameworkEnum.LLAMA_INDEX)
|
24
|
+
async def nim_llama_index(llm_config: NIMModelConfig, builder: Builder):
|
25
|
+
|
26
|
+
from llama_index.llms.nvidia import NVIDIA
|
27
|
+
|
28
|
+
kwargs = llm_config.model_dump(exclude={"type"}, by_alias=True)
|
29
|
+
|
30
|
+
if ("base_url" in kwargs and kwargs["base_url"] is None):
|
31
|
+
del kwargs["base_url"]
|
32
|
+
|
33
|
+
llm = NVIDIA(**kwargs)
|
34
|
+
|
35
|
+
yield llm
|
36
|
+
|
37
|
+
|
38
|
+
@register_llm_client(config_type=OpenAIModelConfig, wrapper_type=LLMFrameworkEnum.LLAMA_INDEX)
|
39
|
+
async def openai_llama_index(llm_config: OpenAIModelConfig, builder: Builder):
|
40
|
+
|
41
|
+
from llama_index.llms.openai import OpenAI
|
42
|
+
|
43
|
+
kwargs = llm_config.model_dump(exclude={"type"}, by_alias=True)
|
44
|
+
|
45
|
+
if ("base_url" in kwargs and kwargs["base_url"] is None):
|
46
|
+
del kwargs["base_url"]
|
47
|
+
|
48
|
+
llm = OpenAI(**kwargs)
|
49
|
+
|
50
|
+
# Disable content blocks
|
51
|
+
llm.supports_content_blocks = False
|
52
|
+
|
53
|
+
yield llm
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
16
|
+
# pylint: disable=unused-import
|
17
|
+
# flake8: noqa
|
18
|
+
# isort:skip_file
|
19
|
+
|
20
|
+
# Import any providers which need to be automatically registered here
|
21
|
+
|
22
|
+
from . import llm
|
23
|
+
from . import tool_wrapper
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
16
|
+
from aiq.builder.builder import Builder
|
17
|
+
from aiq.builder.framework_enum import LLMFrameworkEnum
|
18
|
+
from aiq.builder.function import Function
|
19
|
+
from aiq.cli.register_workflow import register_tool_wrapper
|
20
|
+
|
21
|
+
|
22
|
+
@register_tool_wrapper(wrapper_type=LLMFrameworkEnum.LLAMA_INDEX)
|
23
|
+
def langchain_tool_wrapper(name: str, fn: Function, builder: Builder):
|
24
|
+
|
25
|
+
from llama_index.core.tools import FunctionTool
|
26
|
+
|
27
|
+
assert fn.input_schema is not None, "Tool must have input schema"
|
28
|
+
|
29
|
+
return FunctionTool.from_defaults(async_fn=fn.acall_invoke,
|
30
|
+
name=name,
|
31
|
+
description=fn.description,
|
32
|
+
fn_schema=fn.input_schema)
|