Skip to content

Commit 929f30e

Browse files
committed
add headers
Signed-off-by: Yuchen Zhang <[email protected]>
1 parent d634dfb commit 929f30e

File tree

2 files changed

+44
-9
lines changed

2 files changed

+44
-9
lines changed

tests/aiq/llm_providers/test_langchain_agents.py

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
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.
115
import pytest
216
from langchain_core.messages import AIMessage
317
from langchain_core.prompts import ChatPromptTemplate
@@ -12,22 +26,20 @@
1226
@pytest.mark.integration
1327
@pytest.mark.asyncio
1428
async def test_nim_langchain_agent():
15-
"""Test NIM LLM with LangChain agent. Requires NVIDIA_API_KEY to be set."""
29+
"""
30+
Test NIM LLM with LangChain agent. Requires NVIDIA_API_KEY to be set.
31+
"""
1632

1733
prompt = ChatPromptTemplate.from_messages([("system", "You are a helpful AI assistant."), ("human", "{input}")])
1834

19-
2035
llm_config = NIMModelConfig(model_name="meta/llama-3.1-70b-instruct", temperature=0.0)
2136

22-
2337
async with WorkflowBuilder() as builder:
2438
await builder.add_llm("nim_llm", llm_config)
2539
llm = await builder.get_llm("nim_llm", wrapper_type=LLMFrameworkEnum.LANGCHAIN)
2640

27-
2841
agent = prompt | llm
2942

30-
3143
response = await agent.ainvoke({"input": "What is 1+2?"})
3244
assert isinstance(response, AIMessage)
3345
assert response.content is not None
@@ -38,7 +50,9 @@ async def test_nim_langchain_agent():
3850
@pytest.mark.integration
3951
@pytest.mark.asyncio
4052
async def test_openai_langchain_agent():
41-
"""Test OpenAI LLM with LangChain agent. Requires OPENAI_API_KEY to be set."""
53+
"""
54+
Test OpenAI LLM with LangChain agent. Requires OPENAI_API_KEY to be set.
55+
"""
4256
prompt = ChatPromptTemplate.from_messages([("system", "You are a helpful AI assistant."), ("human", "{input}")])
4357

4458
llm_config = OpenAIModelConfig(model_name="gpt-3.5-turbo", temperature=0.0)
@@ -59,7 +73,11 @@ async def test_openai_langchain_agent():
5973
@pytest.mark.integration
6074
@pytest.mark.asyncio
6175
async def test_aws_bedrock_langchain_agent():
62-
"""Test AWS Bedrock LLM with LangChain agent. Requires AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to be set."""
76+
"""
77+
Test AWS Bedrock LLM with LangChain agent.
78+
Requires AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to be set.
79+
See https://docs.aws.amazon.com/bedrock/latest/userguide/setting-up.html for more information.
80+
"""
6381
prompt = ChatPromptTemplate.from_messages([("system", "You are a helpful AI assistant."), ("human", "{input}")])
6482

6583
llm_config = AWSBedrockModelConfig(model_name="meta.llama3-3-70b-instruct-v1:0",

tests/aiq/llm_providers/test_llama_index_agents.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
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.
115
from typing import Any
216

317
import pytest
@@ -74,8 +88,11 @@ async def test_openai_minimal_agent():
7488
@pytest.mark.integration
7589
@pytest.mark.asyncio
7690
async def test_aws_bedrock_minimal_agent():
77-
"""Test AWS Bedrock LLM with minimal LlamaIndex agent.
78-
Requires AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to be set."""
91+
"""
92+
Test AWS Bedrock LLM with LangChain agent.
93+
Requires AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to be set.
94+
See https://docs.aws.amazon.com/bedrock/latest/userguide/setting-up.html for more information.
95+
"""
7996
llm_config = AWSBedrockModelConfig(model_name="us.meta.llama3-1-405b-instruct-v1:0",
8097
temperature=0.0,
8198
region_name="us-east-2",

0 commit comments

Comments
 (0)