Skip to content

Commit 8670443

Browse files
authored
Merge pull request #8 from serkanh/imporvement/model-selection-via-env-var
Imporvement/model selection via env var
2 parents 192bb8c + ce4a49b commit 8670443

14 files changed

Lines changed: 1240 additions & 113 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -61,63 +61,18 @@ jobs:
6161
PYTHONPATH=$PWD pytest tests/ -v -k "not integration" --tb=short --maxfail=3
6262
continue-on-error: true
6363

64-
- name: Create test environment files
64+
- name: Run full test suite with Docker Compose
6565
run: |
66-
# Create agents/.env for CI testing
67-
cat > agents/.env << EOF
68-
# AI Model API Keys (dummy values for CI)
69-
GOOGLE_API_KEY=dummy_key_for_testing
70-
ANTHROPIC_API_KEY=dummy_key_for_testing
71-
DB_PASSWORD=postgres
72-
AWS_PROFILE=default
73-
AWS_REGION=us-east-1
74-
LOG_LEVEL=INFO
75-
EOF
76-
77-
# Create slack_bot/.env for CI testing
78-
cat > slack_bot/.env << EOF
79-
# Slack App Configuration (dummy values for CI)
80-
SLACK_BOT_TOKEN=xoxb-dummy-token-for-ci
81-
SLACK_SIGNING_SECRET=dummy-signing-secret
82-
SLACK_APP_TOKEN=xapp-dummy-app-token
83-
SRE_AGENT_API_TIMEOUT=30
84-
SESSION_TIMEOUT_MINUTES=60
85-
MAX_ACTIVE_SESSIONS=100
86-
HEALTH_CHECK_INTERVAL=300
87-
EOF
88-
89-
- name: Start PostgreSQL
90-
run: |
91-
docker compose up -d postgres
92-
sleep 10 # Wait for postgres to be ready
93-
94-
- name: Build test image
95-
run: |
96-
docker build \
97-
--target test \
98-
-f ./agents/sre_agent/Dockerfile-agent \
99-
-t sre-bot:test \
100-
.
101-
102-
- name: Run full test suite in Docker
103-
run: |
104-
docker run --rm \
105-
--network sre-bot_default \
106-
-e PYTHONPATH=/app \
107-
-e DB_HOST=postgres \
108-
-e DB_PORT=5432 \
109-
-e DB_NAME=srebot \
110-
-e DB_USER=postgres \
111-
-e DB_PASSWORD=postgres \
112-
sre-bot:test \
113-
pytest tests/ -v --tb=short --maxfail=5
66+
# Use dedicated CI docker-compose configuration
67+
docker compose -f docker-compose.ci.yml up --build --abort-on-container-exit --exit-code-from sre-bot-test
11468
11569
- name: Show test logs on failure
11670
if: failure()
11771
run: |
11872
echo "=== Test execution failed. Checking container logs ==="
119-
docker compose logs postgres || echo "No postgres logs available"
73+
docker compose -f docker-compose.ci.yml logs postgres || echo "No postgres logs available"
74+
docker compose -f docker-compose.ci.yml logs sre-bot-test || echo "No test logs available"
12075
12176
- name: Clean up test environment
12277
if: always()
123-
run: docker compose down -v
78+
run: docker compose -f docker-compose.ci.yml down -v

INITIAL.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,42 @@
11
## FEATURE
22

3-
We need to setup authentication to accesss single or multiple aws systems so we can run queries. It will be role based access that will can assume a remote role that is pre-created and will be able to assume the role to run aws api queries. This is will be used for other
4-
agents as well so should be shareable.
3+
You are an experienced Python developer and you are given a task to implement a feature. We ned to implement a feature where will determine how to initate the agents/agent.py with the proper configuration.
54

65
## EXAMPLES
76

8-
[Provide and explain examples that you have in the `docs/examples/` folder]
7+
If a user is sets env var Google Gemini with `GOOGLE_API_KEY` the initiation should be like this with GOOGLE_AI_MODEL env var that is set default to 'gemini-2.0-flash'
8+
```python
9+
10+
agent = Agent(
11+
name="sre_agent",
12+
model='gemini-2.0-flash',
13+
instruction="""You are an expert Site Reliability Engineer (SRE) assistant specializing in operational tasks,
14+
infrastructure management, and cost optimization.
15+
```
16+
17+
If env var is set to Anthropic with `ANTHROPIC_API_KEY` the initiation should be like this with ANTHROPIC_MODEL env var that is set default to 'claude-3-7-sonnet-20240620'
18+
```
19+
agent = Agent(
20+
name="sre_agent",
21+
model=LiteLlm('claude-3-5-sonnet-20240620'),
22+
instruction="""You are an expert Site Reliability Engineer (SRE) assistant specializing in operational tasks,
23+
infrastructure management, and cost optimization.
24+
```
25+
26+
if env var is "BEDROCK_INFERENCE_PROFILE" the initiation should be like this:
27+
28+
```python
29+
agent = Agent(
30+
name="sre_agent",
31+
model=liteLlm('arn:aws:bedrock:us-west-2:812201244513:inference-profile/us.anthropic.claude-opus-4-1-20250805-v1:0'),
32+
instruction="""You are an expert Site Reliability Engineer (SRE) assistant specializing in operational tasks,
33+
infrastructure management, and cost optimization.
34+
```
935
1036
## DOCUMENTATION
1137
12-
[List out any documentation (web pages, sources for an MCP server like Crawl4AI RAG, etc.) that will need to be referenced during development]
38+
https://google.github.io/adk-docs/agents/models/#method-c-service-account-for-production-automation
1339
1440
## OTHER CONSIDERATIONS
1541
16-
- Should be simple to configure perhaps requiring simply aws role arn and account id.
42+

0 commit comments

Comments
 (0)