Skip to content

Commit eb608e9

Browse files
Abhijit LAbhijit L
authored andcommitted
Merge branch 'main' into update_makefile
2 parents f4b3224 + 6e4bb4e commit eb608e9

63 files changed

Lines changed: 2990 additions & 1931 deletions

File tree

Some content is hidden

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

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[flake8]
22
max-line-length = 88
3-
exclude = .git,.github,.chglog,__pycache__,docs,venv
3+
exclude = .git,.github,.chglog,__pycache__,docs,venv,env,mypy_cache
44
max-complexity = 10
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Update v0.0.2-weekly - June 30, 2025
1+
## Update: Version v0.0.3-weekly (July 7, 2025)
22

3-
We're excited to share the latest updates in our v0.0.2-weekly release. For a detailed look at the changes between this and our previous release, please visit our [GitHub page](https://github.com/getjavelin/compare/v0.0.1-weekly...v0.0.2-weekly).
3+
Explore what's new in the latest release of our software.
44

5-
Stay tuned for more updates in the upcoming releases!
5+
For more details on the changes made in this update, you can view the specific comparisons:
6+
- To see what's different from the previous weekly version, check out the [comparison with v0.0.2-weekly](https://github.com/getjavelin/javelin-python/compare/v0.0.2-weekly...v0.0.3-weekly).
7+
- For ongoing developments beyond this release, take a look at the [comparison with our latest work](https://github.com/getjavelin/javelin-python/compare/v0.0.3-weekly...HEAD).
68

79
---
810

changelogs/WEEKLY-CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## Update: Version v0.0.3-weekly (July 7, 2025)
2+
3+
Explore what's new in the latest release of our software.
4+
5+
For more details on the changes made in this update, you can view the specific comparisons:
6+
- To see what's different from the previous weekly version, check out the [comparison with v0.0.2-weekly](https://github.com/getjavelin/javelin-python/compare/v0.0.2-weekly...v0.0.3-weekly).
7+
- For ongoing developments beyond this release, take a look at the [comparison with our latest work](https://github.com/getjavelin/javelin-python/compare/v0.0.3-weekly...HEAD).
8+
9+
---
10+
111
# Update v0.0.2-weekly - June 30, 2025
212

313
We're excited to share the latest updates in our v0.0.2-weekly release. For a detailed look at the changes between this and our previous release, please visit our [GitHub page](https://github.com/getjavelin/compare/v0.0.1-weekly...v0.0.2-weekly).
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
from .agent import root_agent

examples/agents/adk_gemini_agent_javelin/agent.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@
6969
# Coordinator agent
7070
root_agent = SequentialAgent(
7171
name="GeminiMultiAgentCoordinator",
72-
sub_agents=[research_agent, summary_agent, report_agent]
72+
sub_agents=[research_agent, summary_agent, report_agent],
7373
)
7474

75+
7576
async def main():
7677
session_service = InMemorySessionService()
7778
session_service.create_session("gemini_multi_agent_app", "user", "sess")
@@ -93,5 +94,6 @@ async def main():
9394

9495
print("\n--- Final Report ---\n", final_answer)
9596

97+
9698
if __name__ == "__main__":
9799
asyncio.run(main())
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
from .agent import root_agent

examples/agents/adk_openai_agent_javelin/agent.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
# Coordinator agent running all three sequentially
7070
coordinator = SequentialAgent(
7171
name="OpenAI_MultiAgentCoordinator",
72-
sub_agents=[research_agent, summary_agent, report_agent]
72+
sub_agents=[research_agent, summary_agent, report_agent],
7373
)
7474
root_agent = coordinator
7575

@@ -96,5 +96,6 @@ async def main():
9696

9797
print("\n--- Final Report ---\n", final_answer)
9898

99+
99100
if __name__ == "__main__":
100-
asyncio.run(main())
101+
asyncio.run(main())

examples/agents/openai_agents_javelin.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,19 @@
2727
javelin_base_url = os.getenv("JAVELIN_BASE_URL", "")
2828

2929
if not (openai_api_key and javelin_api_key and javelin_base_url):
30-
raise ValueError("Missing OPENAI_API_KEY, JAVELIN_API_KEY, or JAVELIN_BASE_URL in .env")
30+
raise ValueError(
31+
"Missing OPENAI_API_KEY, JAVELIN_API_KEY, or JAVELIN_BASE_URL in .env"
32+
)
3133

3234
# Create async OpenAI client
3335
async_openai_client = AsyncOpenAI(api_key=openai_api_key)
3436

3537
# Register with Javelin
36-
javelin_client = JavelinClient(JavelinConfig(
37-
javelin_api_key=javelin_api_key,
38-
base_url=javelin_base_url
39-
))
40-
javelin_client.register_openai(async_openai_client, route_name="openai_univ") # Adjust route name if needed
38+
javelin_client = JavelinClient(
39+
JavelinConfig(javelin_api_key=javelin_api_key, base_url=javelin_base_url)
40+
)
41+
# Adjust route name if needed
42+
javelin_client.register_openai(async_openai_client, route_name="openai_univ")
4143

4244
# Let the Agents SDK use this Javelin-patched client globally
4345
set_default_openai_client(async_openai_client)
@@ -59,7 +61,7 @@
5961
##############################################################################
6062
translator_agent = Agent(
6163
name="TranslatorAgent",
62-
instructions="Translate any English text into Spanish. Keep it concise."
64+
instructions="Translate any English text into Spanish. Keep it concise.",
6365
)
6466

6567
##############################################################################
@@ -78,18 +80,20 @@
7880
tools=[
7981
faux_search_agent.as_tool(
8082
tool_name="summarize_topic",
81-
tool_description="Produce a concise internal summary of the user’s topic."
83+
tool_description="Produce a concise internal summary of the user’s topic.",
8284
),
8385
translator_agent.as_tool(
8486
tool_name="translate_to_spanish",
85-
tool_description="Translate text into Spanish."
87+
tool_description="Translate text into Spanish.",
8688
),
8789
],
8890
)
8991

9092
##############################################################################
9193
# 5) Demo Usage
9294
##############################################################################
95+
96+
9397
async def main():
9498
user_query = "Why is pollution increasing ?"
9599
print(f"\n=== User Query: {user_query} ===\n")
@@ -98,5 +102,6 @@ async def main():
98102
print("=== Final Output ===\n")
99103
print(final_result.final_output)
100104

105+
101106
if __name__ == "__main__":
102107
asyncio.run(main())

examples/anthropic/anthropic_api_function_calling.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
# Headers
1717
headers = {
1818
"Content-Type": "application/json",
19-
"x-javelin-route": "anthropic_univ", # add your universal route
20-
"x-javelin-model": "claude-3-5-sonnet-20240620", # add any supported model
19+
"x-javelin-route": "anthropic_univ", # add your universal route
20+
"x-javelin-model": "claude-3-5-sonnet-20240620", # add any supported model
2121
"x-javelin-provider": "https://api.anthropic.com/v1",
22-
"x-api-key": os.getenv("ANTHROPIC_API_KEY"),
22+
"x-api-key": os.getenv("ANTHROPIC_API_KEY"),
2323
"anthropic-version": "2023-06-01",
2424
}
2525
client.set_headers(headers)
@@ -44,7 +44,9 @@
4444
messages = [
4545
{
4646
"role": "user",
47-
"content": [{"type": "text", "text": "What's the weather like in Mumbai in celsius?"}],
47+
"content": [
48+
{"type": "text", "text": "What's the weather like in Mumbai in celsius?"}
49+
],
4850
}
4951
]
5052

examples/anthropic/anthropic_function_call.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
# Load environment variables
88
from dotenv import load_dotenv
9+
910
load_dotenv()
1011

1112
# Javelin Setup
@@ -25,7 +26,10 @@
2526

2627
# Messages and dummy tool call (check if tool support throws any error)
2728
messages = [
28-
{"role": "user", "content": "Please call the tool to fetch today's weather in Paris."}
29+
{
30+
"role": "user",
31+
"content": "Please call the tool to fetch today's weather in Paris.",
32+
}
2933
]
3034

3135
tools = [
@@ -37,11 +41,12 @@
3741
"properties": {
3842
"city": {"type": "string", "description": "Name of the city"},
3943
},
40-
"required": ["city"]
41-
}
44+
"required": ["city"],
45+
},
4246
}
4347
]
4448

49+
4550
async def run_anthropic_test():
4651
print("\n==== Testing Anthropic Function Calling Support via Javelin ====")
4752
try:
@@ -64,5 +69,6 @@ async def run_anthropic_test():
6469
except Exception as e:
6570
print(f"Function/tool call failed for Anthropic: {str(e)}")
6671

72+
6773
if __name__ == "__main__":
6874
asyncio.run(run_anthropic_test())

0 commit comments

Comments
 (0)