Skip to content

Commit 55dbc79

Browse files
authored
Merge branch 'main' into bppeulen-opensearch1
2 parents ff13051 + 070e4cc commit 55dbc79

File tree

99 files changed

+17429
-86
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+17429
-86
lines changed

.gitignore

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,5 @@
1-
# General
2-
.DS_Store
3-
.AppleDouble
4-
.LSOverride
5-
.vscode
6-
.bak
7-
8-
# Icon must end with two \r
9-
Icon
10-
11-
12-
# Thumbnails
13-
._*
14-
15-
# Files that might appear in the root of a volume
16-
.DocumentRevisions-V100
17-
.fseventsd
18-
.Spotlight-V100
19-
.TemporaryItems
20-
.Trashes
21-
.VolumeIcon.icns
22-
.com.apple.timemachine.donotpresent
23-
24-
# Directories potentially created on remote AFP share
25-
.AppleDB
26-
.AppleDesktop
27-
Network Trash Folder
28-
Temporary Items
29-
.apdisk
30-
31-
# ignore common security keys
32-
.key
33-
.crt
34-
.csr
35-
.pem
1+
.gitignore
2+
shared-assets/bastion-py-script/.oci/
3+
shared-assets/bastion-py-script/temp/
4+
temp/
5+
app-dev/app-integration-and-automation/oracle-integration-cloud/01-oic-connectivity-agent/README_tmp.html

ai/gen-ai-agents/README.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
11
# Generative AI Agents service
22

3-
Oracle’s AI strategy is to make artificial intelligence (AI) pervasive across its cloud applications and cloud infrastructure. We serve business users who want to improve business processes and outcomes through prebuilt AI capabilities, data scientists and developers who want complete control to build and deploy AI models of any kind, and independent software vendors (ISVs) who want the most performant and cost-effective platform to host their AI services.
4-
5-
Reviewed: 13.11.2024
3+
Oracle’s Generative AI Agents is a fully managed service that combines the power of large language models (LLMs) with an intelligent retrieval system to create contextually relevant answers by searching your knowledge base, making your AI applications smart and efficient. The service provides up-to-date information through a natural language interface and the ability to act directly on it.
4+
5+
# Team Publications
6+
7+
- [Live Lab : Oracle Generative AI Agent: Multi-Format Search. Installation to Advanced Techniques](https://livelabs.oracle.com/pls/apex/dbpm/r/livelabs/view-workshop?wid=4112)
8+
- [Live Lab : Build an AI assistant you can access through Slack, Teams and more - Oracle LiveLabs](https://livelabs.oracle.com/pls/apex/dbpm/r/livelabs/view-workshop?wid=4015)
9+
- [Analysis of Structured Data and Use of AI Agents](https://luigi-saetta.medium.com/analysis-of-structured-data-and-use-of-ai-agents-a40f18da4ed5)
10+
- [AI Agents: The Future of Intelligent Systems in 2025](https://medium.com/@anshuman4luv/ai-agents-the-future-of-intelligent-systems-in-2025-5558c13aa328)
11+
- [LangChain vs LangGraph vs LangFlow vs LangSmith: A Detailed Comparison](https://medium.com/@anshuman4luv/langchain-vs-langgraph-vs-langflow-vs-langsmith-a-detailed-comparison-74bc0d7ddaa9)
12+
13+
## Reusable Assets Overview
14+
- [HCM agent created by partner Conneqtion Group which contains agents to connect to Fusion HCM, Expense and many others](https://www.youtube.com/watch?v=OhZcWx_H_tQ)
15+
- [Finance analytics agent created by our partner TPX impact](https://bit.ly/genai4analyst)
16+
17+
# Useful Links
18+
19+
- [AI Solutions Hub](https://www.oracle.com/artificial-intelligence/solutions/)
20+
- [GEN AI Agents](https://docs.oracle.com/en-us/iaas/Content/generative-ai-agents/home.htm)
21+
- [AI Agents Overview](https://docs.oracle.com/en-us/iaas/Content/generative-ai-agents/overview.htm)
22+
23+
24+
25+
26+
Reviewed: 28.03.2025
627

728

829
# License
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Copyright (c) 2025 Oracle and/or its affiliates.
2+
3+
The Universal Permissive License (UPL), Version 1.0
4+
5+
Subject to the condition set forth below, permission is hereby granted to any
6+
person obtaining a copy of this software, associated documentation and/or data
7+
(collectively the "Software"), free of charge and under any and all copyright
8+
rights in the Software, and any and all patent rights owned or freely
9+
licensable by each licensor hereunder covering either (i) the unmodified
10+
Software as contributed to or provided by such licensor, or (ii) the Larger
11+
Works (as defined below), to deal in both
12+
13+
(a) the Software, and
14+
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
15+
one is included with the Software (each a "Larger Work" to which the Software
16+
is contributed by such licensors),
17+
18+
without restriction, including without limitation the rights to copy, create
19+
derivative works of, display, perform, and distribute the Software and make,
20+
use, sell, offer for sale, import, export, have made, and have sold the
21+
Software and the Larger Work(s), and to sublicense the foregoing rights on
22+
either these or other terms.
23+
24+
This license is subject to the following condition:
25+
The above copyright notice and either this complete permission notice or at
26+
a minimum a reference to the UPL must be included in all copies or
27+
substantial portions of the Software.
28+
29+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35+
SOFTWARE.
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
Copyright (c) 2025 Oracle and/or its affiliates.
2+
"""
3+
By Omar Salem
4+
assistant.py - AI Assistant Chatbot (Dynamic Routing).
5+
"""
6+
7+
from state import State
8+
from router import Router
9+
from tools import (
10+
handle_fetch_gmail,
11+
handle_send_email,
12+
handle_ai_agent_query,
13+
handle_select_email,
14+
handle_schedule_email,
15+
handle_llm_query,
16+
handle_weather_query,
17+
handle_calculator,
18+
# handle_generate_reply_with_weather,
19+
handle_generate_reply_with_user_message_and_ai_response,
20+
handle_generate_reply_with_user_message_only,
21+
handle_book_meeting
22+
)
23+
import json
24+
25+
# initialize router
26+
router = Router()
27+
28+
# initialize State
29+
state: State = {
30+
"input": "",
31+
"decisions": [],
32+
"output": "",
33+
"emails": [],
34+
"selected_email": None,
35+
"recipient": "",
36+
"subject": "",
37+
"body": "",
38+
"ai_response": "",
39+
"citations": [],
40+
}
41+
42+
# dynamically map tools
43+
TOOLS = {
44+
"fetch_and_summarize": handle_fetch_gmail,
45+
"send_email": handle_send_email,
46+
"ai_agent": handle_ai_agent_query,
47+
"select_email": handle_select_email,
48+
"schedule_email": handle_schedule_email,
49+
"llm_query": handle_llm_query,
50+
"weather_query": handle_weather_query,
51+
"calculator": handle_calculator,
52+
"generate_reply_with_user_message_only": handle_generate_reply_with_user_message_only,
53+
"generate_reply_with_user_message_and_ai_response": handle_generate_reply_with_user_message_and_ai_response,
54+
"book_meeting": handle_book_meeting,
55+
}
56+
57+
58+
def chatbot():
59+
"""Interactive Chatbot for AI Assistant"""
60+
print("\n **AI Assistant** - Type 'exit' to quit.\n")
61+
62+
while True:
63+
# get user input
64+
user_input = input("📝 You: ").strip()
65+
if user_input.lower() in ["exit", "quit"]:
66+
print("\n👋 Exiting. Have a great day!")
67+
break
68+
69+
# update State
70+
state["input"] = user_input
71+
72+
# dynamic routing assignment
73+
routing_result = router.route(state)
74+
state["decisions"] = routing_result.get("decisions", [])
75+
76+
print(f"\n🤖 **Routing Decisions:** `{state['decisions']}`\n")
77+
78+
# store responses from multiple tools
79+
responses = []
80+
81+
#dynamically execute tools
82+
for decision in state["decisions"]:
83+
tool = TOOLS.get(decision)
84+
if tool:
85+
result = tool(state) # execute tool picked dynamically
86+
responses.append(result["output"])
87+
else:
88+
responses.append(f"❌ Invalid decision: `{decision}`.")
89+
90+
# convert lists to formatted JSON strings before joining
91+
state["output"] = "\n\n".join(
92+
[json.dumps(resp, indent=2) if isinstance(resp, list) else str(resp) for resp in responses]
93+
)
94+
95+
# display Output
96+
print(f"\n✅ **Response:**\n{state['output']}\n")
97+
98+
99+
# run the Chatbot
100+
if __name__ == "__main__":
101+
chatbot()
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
Copyright (c) 2025 Oracle and/or its affiliates.
2+
import streamlit as st
3+
import json
4+
import time
5+
from assistant import TOOLS, router, state
6+
7+
# ==============================
8+
# STREAMLIT UI CONFIGURATION
9+
# ==============================
10+
st.set_page_config(page_title="OCI Assistant Chatbot", layout="wide")
11+
12+
st.markdown(
13+
"<h1 style='text-align: center;'>OCI Assistant Chatbot</h1>",
14+
unsafe_allow_html=True
15+
)
16+
st.write("Manage your emails, schedule meetings, check the weather, and more...")
17+
18+
# ==============================
19+
# INITIALIZE SESSION STATE
20+
# ==============================
21+
if "chat_history" not in st.session_state:
22+
st.session_state.chat_history = []
23+
24+
if "selected_email" not in st.session_state:
25+
st.session_state.selected_email = None
26+
27+
if "latest_response" not in st.session_state:
28+
st.session_state.latest_response = ""
29+
30+
# ==============================
31+
# CHATBOT INTERFACE
32+
# ==============================
33+
34+
# Display chat history
35+
for chat in st.session_state.chat_history:
36+
with st.chat_message("user"):
37+
st.markdown(chat["user"])
38+
with st.chat_message("assistant"):
39+
st.markdown(chat["bot"])
40+
41+
# User input field
42+
user_input = st.text_input("Type your message here...", key="user_input")
43+
44+
# Process user message
45+
if st.button("Send"):
46+
if user_input:
47+
# Display steps
48+
step_placeholder = st.empty() # This will dynamically update
49+
step_placeholder.markdown("🟢 **Step 1:** Capturing user input...")
50+
51+
# Update state with user input
52+
state["input"] = user_input
53+
54+
# Display second step
55+
step_placeholder.markdown("🟢 **Step 2:** Identifying the correct tool...")
56+
57+
# Show spinner while routing
58+
with st.spinner("Processing..."):
59+
time.sleep(1) # Simulating delay
60+
61+
# Route input to the correct function
62+
routing_result = router.route(state)
63+
state["decisions"] = routing_result.get("decisions", [])
64+
65+
# Show detected decisions
66+
step_placeholder.markdown(f"🟢 **Step 3:** Decision made → `{state['decisions']}`")
67+
68+
# Execute tool functions
69+
responses = []
70+
for i, decision in enumerate(state["decisions"], start=1):
71+
step_placeholder.markdown(f"🟢 **Step 4.{i}:** Executing `{decision}`...")
72+
73+
tool = TOOLS.get(decision)
74+
if tool:
75+
with st.spinner(f"Running `{decision}`..."):
76+
time.sleep(1) # Simulate processing time
77+
result = tool(state)
78+
responses.append(result["output"])
79+
else:
80+
responses.append(f"❌ Invalid decision: `{decision}`.")
81+
82+
# Finalize response
83+
step_placeholder.markdown("✅ **Step 5:** Formatting response...")
84+
85+
# Store response
86+
state["output"] = "\n\n".join(
87+
[json.dumps(resp, indent=2) if isinstance(resp, list) else str(resp) for resp in responses]
88+
)
89+
90+
# Update chat history
91+
st.session_state.chat_history.append({"user": user_input, "bot": state["output"]})
92+
93+
# Store latest response
94+
st.session_state.latest_response = state["output"]
95+
96+
# Refresh UI
97+
st.rerun()

0 commit comments

Comments
 (0)