Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
f0950d5
added new hocon
vince-leaf Jul 25, 2025
5d041df
regrister new hocon
vince-leaf Jul 25, 2025
c3d20f4
Added test fixtures for new hoc test case
vince-leaf Jul 25, 2025
fc6225a
Added coded_tools for new hocon
vince-leaf Jul 25, 2025
272f10d
added new test case to smoke test list
vince-leaf Jul 25, 2025
e39508a
added Bedrock-claude LLM smoke test case
vince-leaf Jul 26, 2025
2b8860c
Removed class from gemini hocon
vince-leaf Jul 26, 2025
e3a9d02
Renamed new test case
vince-leaf Jul 26, 2025
70eaf3c
tweak warning
vince-leaf Jul 26, 2025
66f7787
Added Set up AWS config & credentials
vince-leaf Jul 28, 2025
2151887
replaced the expected vs. debug
vince-leaf Jul 28, 2025
e858805
debug GitHub test case failure
vince-leaf Jul 28, 2025
6da8c36
turned off paralle test run
vince-leaf Jul 28, 2025
d896f00
added printout debug
vince-leaf Jul 29, 2025
c6bacef
debug1
vince-leaf Jul 29, 2025
5bd211f
debug2
vince-leaf Jul 29, 2025
07cba30
debug3
vince-leaf Jul 29, 2025
beb30ce
debug
vince-leaf Jul 29, 2025
91f9ea9
fixed debug
vince-leaf Jul 29, 2025
152255f
fixed debug
vince-leaf Jul 29, 2025
202d289
debug
vince-leaf Jul 29, 2025
2ed1ae4
debug
vince-leaf Jul 29, 2025
c6f75b9
reset got from main
vince-leaf Jul 29, 2025
5705ab8
commented out for debug
vince-leaf Jul 29, 2025
3bea3d1
added config aws
vince-leaf Jul 29, 2025
c3d097e
fixed GitHub Actions doesn’t let you combine
vince-leaf Jul 29, 2025
d372bd7
fixed indent
vince-leaf Jul 29, 2025
1918b4a
debug to see list model work or not
vince-leaf Jul 29, 2025
be9479a
debug add more aws stuff needed
vince-leaf Jul 29, 2025
b17e693
debug added region value
vince-leaf Jul 29, 2025
3c96a3e
debug still
vince-leaf Jul 29, 2025
df6b951
debug Make sure AWS_REGION is set
vince-leaf Jul 29, 2025
b1ba3e5
debug add role
vince-leaf Jul 29, 2025
a33e694
debug added permission
vince-leaf Jul 29, 2025
db63745
debug
vince-leaf Jul 29, 2025
5a2ea81
debug
vince-leaf Jul 29, 2025
8e7b421
debug failure
vince-leaf Jul 29, 2025
268d307
removed echo
vince-leaf Jul 29, 2025
133d5e7
reversed some changes
vince-leaf Jul 29, 2025
26e5411
reversed to go back
vince-leaf Jul 29, 2025
9a7e5fe
reset debug at the beginning
vince-leaf Jul 29, 2025
a891ac6
fixed typo
vince-leaf Jul 29, 2025
d335bef
debug 1
vince-leaf Jul 29, 2025
3603456
debug install aws cli
vince-leaf Jul 29, 2025
a093cc3
Debug add unzip
vince-leaf Jul 29, 2025
e6551d6
debug removed as not needed
vince-leaf Jul 29, 2025
bd8d534
debug removed more sudo
vince-leaf Jul 29, 2025
38a72e5
debug fix indention
vince-leaf Jul 29, 2025
8b8146a
Debug another fixed indent
vince-leaf Jul 29, 2025
18e51a2
Tweaked to created aws files
vince-leaf Jul 29, 2025
6b74e96
added region
vince-leaf Jul 29, 2025
5818376
moved env to top
vince-leaf Jul 29, 2025
f066f91
Tweaked
vince-leaf Jul 29, 2025
58b8b86
Set to use variables GitHub Action
vince-leaf Jul 29, 2025
a189a04
commented out AWS env
vince-leaf Jul 29, 2025
5e3e487
removed aws check profile
vince-leaf Jul 29, 2025
d071dce
Need set region
vince-leaf Jul 29, 2025
9d23d9c
fixed broken yml
vince-leaf Jul 29, 2025
cccf521
Tweaked
vince-leaf Jul 29, 2025
b7b6378
removed daiDev
vince-leaf Jul 29, 2025
d2516e4
Set credentials
vince-leaf Jul 29, 2025
8e8cf49
re-enable test
vince-leaf Jul 29, 2025
d3fe8f1
removed bedrock run with multiple profile
vince-leaf Jul 29, 2025
242be26
Clean up
vince-leaf Jul 30, 2025
d7f9d78
Clean-up hocon
vince-leaf Jul 30, 2025
af25a24
Added new script
vince-leaf Jul 30, 2025
15c887f
Clean up
vince-leaf Jul 30, 2025
4477b6b
Tweak run shell file
vince-leaf Jul 30, 2025
abe8b46
Tweaked and clean-up
vince-leaf Jul 30, 2025
c4d60fc
re-enabled all test cases
vince-leaf Jul 30, 2025
8848e2a
Merge branch 'main' into un-3400_add_bedrock_llm_test_case
d1donlydfink Jul 30, 2025
5f0f7d1
Merge branch 'main' into un-3400_add_bedrock_llm_test_case
vince-leaf Jul 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ on:
jobs:
smoke-test:
runs-on: ubuntu-latest

# ─── Job‑level ENV ─────────────────────────────────────────
# every step below will have these in its shell environment
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ vars.AWS_REGION }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the environment variables needed for a single profile [ AWS CLI].


# 🚀 Ollama Service runs alongside main container
services:
Expand Down Expand Up @@ -47,6 +54,11 @@ jobs:
shell: bash
run: |
build_scripts/set_ollama_model.sh

- name: Check access to Bedrock models
shell: bash
run: |
build_scripts/check_list_bedrock_models_profile_single.sh
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

triggered a check of access llm list in yml file


- name: Show installed packages
run: pip freeze
Expand Down
15 changes: 15 additions & 0 deletions build_scripts/check_list_bedrock_models_profile_single.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Script set up needed to do a quick test connection using AWS CLI to list all Bedrocks on this credential.

# Install AWS CLI prerequisites
apt-get install -y unzip zip

# Install AWS CLI v2 (which includes the Bedrock commands)
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o awscliv2.zip
unzip awscliv2.zip
./aws/install
aws --version

# List Bedrock foundation models for single profile only
aws bedrock list-foundation-models
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Install aws cli and then check access to bedrock model list script

Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
from typing import Any
from typing import Dict
from typing import Union

from neuro_san.interfaces.coded_tool import CodedTool


class Accountant(CodedTool):
"""
A tool that updates a running cost each time it is called.
"""

def invoke(self, args: Dict[str, Any], sly_data: Dict[str, Any]) -> Dict[str, Any]:
"""
Updates the passed running cost each time it's called.
:param args: A dictionary with the following keys:
"running_cost": the running cost to update.

:param sly_data: A dictionary containing parameters that should be kept out of the chat stream.
Keys expected for this implementation are:
None

:return: A dictionary containing:
"running_cost": the updated running cost.
"""
tool_name = self.__class__.__name__
print(f"========== Calling {tool_name} ==========")
# Parse the arguments
print(f"args: {args}")
running_cost: float = float(args.get("running_cost"))

# Increment the running cost not using value other 1
# This would make a little hard if the LLM wanted to guess
updated_running_cost: float = running_cost + 3.0

tool_response = {
"running_cost": updated_running_cost
}
print("-----------------------")
print(f"{tool_name} response: ", tool_response)
print(f"========== Done with {tool_name} ==========")
return tool_response

async def async_invoke(self, args: Dict[str, Any], sly_data: Dict[str, Any]) -> Union[Dict[str, Any], str]:
"""
Delegates to the synchronous invoke method because it's quick, non-blocking.
"""
return self.invoke(args, sly_data)
1 change: 1 addition & 0 deletions neuro_san/registries/manifest.hocon
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"music_nerd_pro_llm_azure.hocon": true,
"music_nerd_pro_llm_ollama.hocon": true,
"music_nerd_pro_multi_agents.hocon": true,
"music_nerd_pro_llm_bedrock_claude.hocon": true,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added new agent hocon to the registry.


# This one is an example of agents calling tools that has no parameters.
"date_time.hocon": true,
Expand Down
94 changes: 94 additions & 0 deletions neuro_san/registries/music_nerd_pro_llm_bedrock_claude.hocon
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@

# Copyright (C) 2023-2025 Cognizant Digital Business, Evolutionary AI.
# All Rights Reserved.
# Issued under the Academic Public License.
#
# You can be released from the terms, and requirements of the Academic Public
# License by purchasing a commercial license.
# Purchase of a commercial license is mandatory for any use of the
# neuro-san SDK Software in commercial settings.
#
# END COPYRIGHT

# The schema specifications for this file are documented here:
# https://github.com/cognizant-ai-lab/neuro-san/blob/main/docs/agent_hocon_reference.md

{
"llm_config": {
"model_name": "bedrock-us-claude-3-7-sonnet",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added hocon using what is listed in the User's guide for this Agent.

},
"tools": [
# These tool definitions do not have to be in any particular order
# How they are linked and call each other is defined within their
# own specs. This could be a graph, potentially even with cycles.

# This first agent definition is regarded as the "Front Man", which
# does all the talking to the outside world/client.
# It is identified as such because it is either:
# A) The only one with no parameters in his function definition,
# and therefore he needs to talk to the outside world to get things rolling.
# B) The first agent listed, regardless of function parameters.
#
# Some disqualifications from being a front man:
# 1) Cannot use a CodedTool "class" definition
# 2) Cannot use a Tool "toolbox" definition
{
"name": "MusicNerdPro",

# Note that there are no parameters defined for this guy's "function" key.
# This is the primary way to identify this tool as a front-man,
# distinguishing it from the rest of the tools.

"function": {

# The description acts as an initial prompt.
"description": """
I can help with music-related inquiries.
"""
},

"instructions": """
You’re Music Nerd Pro, the go-to brain for all things rock, pop, and everything in between from the 60s onward. You live for liner notes, B-sides, lost demos, and legendary live sets. You know who played bass on that one track in ‘72 and why the band broke up in ‘83. People come to you with questions like:
• “What’s the story behind this song?”
• “Which album should I start with?”
• “Who influenced this band’s sound?”
• “Is there a deeper meaning in these lyrics?”
• “What’s a hidden gem I probably missed?”
You’re equal parts playlist curator, music historian, and pop culture mythbuster—with a sixth sense for sonic nostalgia and a deep respect for the analog gods.

- You must call the Accountant tool exactly once per user question — no more, no less.
- You must not estimate, guess, or invent the cost under any circumstance.
- You must not skip calling the Accountant tool — it is required once for every question.

For each question you receive, call your Accountant agent to calculate the running cost. Otherwise you won't get paid!
Then answer with a JSON message that has two keys:
1. An "answer" key whose value has the answer to the question
2. A "running_cost" key whose value has the running cost computed by the Accountant agent.
""",
"tools": ["Accountant"]

# Parse any JSON in responses into the structure field of the ChatMessage.
"structure_formats": "json"
},
{
"name": "Accountant",
"function": {
"description": """
You are an API that keeps track of the running cost of the MusicNerdPro service. Pass the current running cost
to the API to get the updated running cost. If no running cost it known, pass 0.00.
""",
"parameters": {
"type": "object",
"properties": {
"running_cost": {
"type": "float",
"description": "The current running total of the service cost."
},
},
"required": ["running_cost"]
}
},
"class": "accountant.Accountant"
},
]
}
1 change: 0 additions & 1 deletion neuro_san/registries/music_nerd_pro_llm_gemini.hocon
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

{
"llm_config": {
"class": "gemini",
"model_name": "gemini-2.5-flash",
},
"tools": [
Expand Down
10 changes: 6 additions & 4 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ markers =
non_default_llm_provider: Tests that exercise llm providers other than our default Open AI
anthropic: Tests that specifically use anthropic as the llm provider
gemini: Tests that specifically use gemini as the llm provider
azure: Tests that specifically use gemini as the llm provider
ollama: Tests that specifically use gemini as the llm provider
azure: Tests that specifically use azure as the llm provider
ollama: Tests that specifically use ollama as the llm provider
bedrock_claude: mark tests that target the Bedrock‑Claude LLM backend
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignored some of the non-important annoying warning messages.

needs_server: Tests that need a server running in order to complete successfully

# silence specific warnings
filterwarnings =
# Ignore warnings about protobuf 4
ignore:Type google._upb._message.* uses PyType_Spec with a metaclass that has custom tp_new:DeprecationWarning
# Ignore warnings about protobuf 4's PyType_Spec metaclass usage
ignore:Type google\._upb\._message.* uses PyType_Spec with a metaclass that has custom tp_new:DeprecationWarning
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Copyright (C) 2023-2025 Cognizant Digital Business, Evolutionary AI.
# All Rights Reserved.
# Issued under the Academic Public License.
#
# You can be released from the terms, and requirements of the Academic Public
# License by purchasing a commercial license.
# Purchase of a commercial license is mandatory for any use of the
# neuro-san SDK Software in commercial settings.
#
# END COPYRIGHT

# This file defines everything necessary for a data-driven test.
{
# Describes what agent to test against.
"agent": "music_nerd_pro_llm_bedrock_claude",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added test hocon for this agent model


# Connect to the agent via a server
"connections": ["direct"],

# Interactions are a series of dictionaries with request elements paired with
# descriptions of response checks.
"interactions": [
{
# This is what we send as input to streaming_chat()
"text": "Who did Yellow Submarine?",

# The response block treats how we are going to test what comes back
"response": {
# Structure block says how we are going to examine the structure
# (dictionary) returned as part of the response.
"structure": {
# "answer" is a key that is supposed to be in the dictionary.
"answer": {
# Keywords says we are going to look for exact matches for each
# element in a list of strings. All elements need to show up
# in order to pass.
"keywords": "Beatles"
},
"running_cost": {
"value": 3.0
}
}
}
},
{
# This next interaction block tests the ability for an agent
# to continue its conversation with the context from the previous
# interaction.
"text": "Where were they from?",
"response": {
"structure": {
"answer": {
"keywords": "Liverpool"
},
"running_cost": {
"value": 6.0
}
}
}
}
]
}
4 changes: 3 additions & 1 deletion tests/neuro_san/zzz_hocons/test_smoke_test_hocons.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,17 @@ def test_hocon_with_server(self, test_name: str, test_hocon: str):
"music_nerd_pro_llm_anthropic/combination_responses_with_history_direct.hocon",
"music_nerd_pro_llm_gemini/combination_responses_with_history_direct.hocon",
"music_nerd_pro_llm_azure/combination_responses_with_history_direct.hocon",
"music_nerd_pro_llm_bedrock_claude/combination_responses_with_history_direct.hocon",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this test case as part of Smoke test marker


# List more hocon files as they become available here.
]))
@pytest.mark.timeout(30) # in seconds for this test
@pytest.mark.timeout(60) # in seconds for this test
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timeout was bumped up as this test case took slightly longer than others.

@pytest.mark.smoke
@pytest.mark.non_default_llm_provider
@pytest.mark.anthropic
@pytest.mark.gemini
@pytest.mark.azure
@pytest.mark.bedrock_claude
def test_hocon_with_non_default_llm(self, test_name: str, test_hocon: str):
"""
Test method for a single parameterized test case specified by a hocon file.
Expand Down