Skip to content

Commit e0cb876

Browse files
authored
Merge pull request #1 from madebygps/pamela-examples
tweaked some spanish words and ran pre-commit
2 parents 4990cfb + bbbeefc commit e0cb876

27 files changed

Lines changed: 206 additions & 116 deletions

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ Verify that the following are valid
4242
* ...
4343

4444
## Other Information
45-
<!-- Add any other helpful information that may be needed here. -->
45+
<!-- Add any other helpful information that may be needed here. -->

.github/workflows/azure-dev.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,3 @@ jobs:
5656
run: azd provision --no-prompt
5757
env:
5858
AZD_INITIAL_ENVIRONMENT_CONFIG: ${{ secrets.AZD_INITIAL_ENVIRONMENT_CONFIG }}
59-

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ chances of your issue being dealt with quickly:
4747
* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
4848
causing the problem (line of code or commit)
4949

50-
You can file new issues by providing the above information at the corresponding repository's issues link:
50+
You can file new issues by providing the above information at the corresponding repository's issues link:
5151
replace`[organization-name]` and `[repository-name]` in
5252
`https://github.com/[organization-name]/[repository-name]/issues/new` .
5353

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE
21+
SOFTWARE

examples/agent_basic.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
model_id=os.getenv("GITHUB_MODEL", "openai/gpt-5-mini"),
2828
)
2929
else:
30-
client = OpenAIChatClient(api_key=os.environ["OPENAI_API_KEY"], model_id=os.environ.get("OPENAI_MODEL", "gpt-5-mini"))
30+
client = OpenAIChatClient(
31+
api_key=os.environ["OPENAI_API_KEY"], model_id=os.environ.get("OPENAI_MODEL", "gpt-5-mini")
32+
)
3133

3234
agent = ChatAgent(chat_client=client, instructions="You're an informational agent. Answer questions cheerfully.")
3335

examples/agent_mcp_local.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
model_id=os.getenv("GITHUB_MODEL", "openai/gpt-5-mini"),
3838
)
3939
else:
40-
client = OpenAIChatClient(api_key=os.environ["OPENAI_API_KEY"], model_id=os.environ.get("OPENAI_MODEL", "gpt-5-mini"))
40+
client = OpenAIChatClient(
41+
api_key=os.environ["OPENAI_API_KEY"],
42+
model_id=os.environ.get("OPENAI_MODEL", "gpt-5-mini"),
43+
)
4144

4245

4346
async def main() -> None:
@@ -46,7 +49,10 @@ async def main() -> None:
4649
MCPStreamableHTTPTool(name="Expenses MCP Server", url=MCP_SERVER_URL) as mcp_server,
4750
ChatAgent(
4851
chat_client=client,
49-
instructions=f"You help users with tasks using the available tools. Today's date is {datetime.now().strftime('%Y-%m-%d')}.",
52+
instructions=(
53+
"You help users with tasks using the available tools. "
54+
f"Today's date is {datetime.now().strftime('%Y-%m-%d')}."
55+
),
5056
tools=[mcp_server],
5157
) as agent,
5258
):

examples/agent_mcp_remote.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,25 @@
3535
model_id=os.getenv("GITHUB_MODEL", "openai/gpt-5-mini"),
3636
)
3737
else:
38-
client = OpenAIChatClient(api_key=os.environ["OPENAI_API_KEY"], model_id=os.environ.get("OPENAI_MODEL", "gpt-5-mini"))
38+
client = OpenAIChatClient(
39+
api_key=os.environ["OPENAI_API_KEY"],
40+
model_id=os.environ.get("OPENAI_MODEL", "gpt-5-mini"),
41+
)
3942

4043

4144
async def main() -> None:
4245
"""Run an agent that uses a remote MCP server (Microsoft Learn) to answer documentation questions."""
4346
async with (
44-
MCPStreamableHTTPTool(name="Microsoft Learn MCP", url="https://learn.microsoft.com/api/mcp") as mcp_server,
47+
MCPStreamableHTTPTool(
48+
name="Microsoft Learn MCP",
49+
url="https://learn.microsoft.com/api/mcp",
50+
) as mcp_server,
4551
ChatAgent(
4652
chat_client=client,
47-
instructions="You help with Microsoft documentation questions. Use the available tools to search for relevant docs.",
53+
instructions=(
54+
"You help with Microsoft documentation questions. "
55+
"Use the available tools to search for relevant docs."
56+
),
4857
tools=[mcp_server],
4958
) as agent,
5059
):

examples/agent_middleware.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ async def process(
178178
logger.warning(f"[❌ Blocking][ Agent Middleware] Request blocked: contains '{word}'")
179179
context.terminate = True
180180
context.result = AgentRunResponse(
181-
messages=[ChatMessage(role=Role.ASSISTANT, text=f"Sorry, I can't process requests about '{word}'.")]
181+
messages=[
182+
ChatMessage(role=Role.ASSISTANT, text=f"Sorry, I can't process requests about '{word}'.")
183+
]
182184
)
183185
return
184186

@@ -217,7 +219,11 @@ async def process(
217219
) -> None:
218220
"""Count messages and log the running total."""
219221
self.total_messages += len(context.messages)
220-
logger.info(f"[🔢 Message Count][ Chat Middleware] Messages in this request: {len(context.messages)}, total so far: {self.total_messages}")
222+
logger.info(
223+
"[🔢 Message Count][ Chat Middleware] Messages in this request: %s, total so far: %s",
224+
len(context.messages),
225+
self.total_messages,
226+
)
221227

222228
await next(context)
223229

examples/agent_supervisor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
model_id=os.getenv("GITHUB_MODEL", "openai/gpt-5-mini"),
4141
)
4242
else:
43-
client = OpenAIChatClient(api_key=os.environ["OPENAI_API_KEY"], model_id=os.environ.get("OPENAI_MODEL", "gpt-5-mini"))
43+
client = OpenAIChatClient(
44+
api_key=os.environ["OPENAI_API_KEY"], model_id=os.environ.get("OPENAI_MODEL", "gpt-5-mini")
45+
)
4446

4547
# ----------------------------------------------------------------------------------
4648
# Sub-agent 1 tools: weekend planning

examples/agent_tool.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
model_id=os.getenv("GITHUB_MODEL", "openai/gpt-5-mini"),
3939
)
4040
else:
41-
client = OpenAIChatClient(api_key=os.environ["OPENAI_API_KEY"], model_id=os.environ.get("OPENAI_MODEL", "gpt-5-mini"))
41+
client = OpenAIChatClient(
42+
api_key=os.environ["OPENAI_API_KEY"], model_id=os.environ.get("OPENAI_MODEL", "gpt-5-mini")
43+
)
4244

4345

4446
def get_weather(

0 commit comments

Comments
 (0)