This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: jaeger-deployment | |
| namespace: __namespace__ | |
| spec: | |
| replicas: 1 | |
| selector: | |
| matchLabels: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import subprocess | |
| import time | |
| import socket | |
| import logging | |
| import os | |
| logger = logging.getLogger(__name__) | |
| class JaegerService: | |
| """Manages local Jaeger container for development""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # model client | |
| def get_fresh_model_client(): | |
| """Create a fresh Azure OpenAI client""" | |
| return AzureOpenAIChatCompletionClient( | |
| model=AZURE_OPENAI_MODEL, | |
| api_version=AZURE_OPENAI_API_VERSION, | |
| azure_deployment=AZURE_OPENAI_DEPLOYMENT, | |
| azure_endpoint=AZURE_OPENAI_ENDPOINT_SWEDEN, | |
| api_key=AZURE_OPENAI_API_KEY_SWEDEN, | |
| timeout=180.0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| az_client = AsyncOpenAI( | |
| api_key=os.environ.get("AZURE_OPEN_AI_API_KEY_SWEDEN"), # Use your OpenAI API key | |
| base_url=os.environ.get("AZURE_OPEN_AI_API_ENDPOINT_SWEDEN"), | |
| ) | |
| gpt_model_client = AzureOpenAIChatCompletionClient( | |
| model="gpt-4.1-mini-2025-04-14", | |
| api_version="2024-06-01", | |
| azure_deployment="gpt-4.1-mini", | |
| azure_endpoint=os.environ.get("AZURE_OPEN_AI_API_ENDPOINT_SWEDEN"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from azure.storage.blob import BlobServiceClient | |
| from datetime import datetime | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| connection_string = os.getenv('storage_connection_string') | |
| def upload_ai_report(report_summary: str, ticker: str): | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import sys | |
| from dotenv import load_dotenv | |
| from autogen_agentchat.agents import AssistantAgent | |
| from autogen_agentchat.base import TaskResult | |
| from autogen_agentchat.conditions import MaxMessageTermination, TextMentionTermination | |
| from autogen_agentchat.messages import BaseChatMessage | |
| from autogen_agentchat.teams import SelectorGroupChat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| runtime = SingleThreadedAgentRuntime() | |
| runtime.start() | |
| message_count = 0 | |
| total_prompt_tokens = 0 | |
| total_completion_tokens = 0 | |
| async for message in market_reserarch_agents_team.run_stream(task="Hello, I would like to know if a stock with ticker=MSFT is a good pick for me to invest in this year?"): | |
| if isinstance(message, TaskResult): | |
| print("Stop Reason:", message.stop_reason) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gpt_model_client = AzureOpenAIChatCompletionClient( | |
| model="gpt-4.1-mini-2025-04-14", | |
| api_version="2024-06-01", | |
| azure_deployment="gpt-4.1-mini", | |
| azure_endpoint=os.environ.get("AZURE_OPEN_AI_API_ENDPOINT_SWEDEN"), | |
| #azure_ad_token_provider=token_provider, # Optional if you choose key-based authentication. | |
| api_key=os.environ.get("AZURE_OPEN_AI_API_KEY_SWEDEN"), | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| market_reserarch_agents_team = SelectorGroupChat( | |
| [planning_agent, doji_agent, alpha_vantage_news_sentiment_agent, alpha_vantage_company_info_agent, fomc_summary_fetch_agent, peer_valuation_modeling_agent, report_generator_agent, report_upload_agent], | |
| termination_condition=termination, | |
| allow_repeated_speaker=True, | |
| model_client=gpt_model_client, | |
| selector_prompt=selector_prompt) |
NewerOlder