Skip to content

Commit b6fb3d3

Browse files
committed
Remove unneeded Azure OpenAI Service env vars, tweak triager example
1 parent 617ea20 commit b6fb3d3

File tree

6 files changed

+23
-13
lines changed

6 files changed

+23
-13
lines changed

examples/langchainv1_mcp_github.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
"https://cognitiveservices.azure.com/.default",
3535
)
3636
base_model = AzureChatOpenAI(
37-
azure_endpoint=os.environ.get("AZURE_OPENAI_ENDPOINT"),
38-
azure_deployment=os.environ.get("AZURE_OPENAI_CHAT_DEPLOYMENT"),
39-
openai_api_version=os.environ.get("AZURE_OPENAI_VERSION"),
37+
azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],
38+
azure_deployment=os.environ["AZURE_OPENAI_CHAT_DEPLOYMENT"],
39+
openai_api_version=os.environ["AZURE_OPENAI_VERSION"],
4040
azure_ad_token_provider=token_provider,
4141
)
4242
elif API_HOST == "github":
@@ -71,7 +71,7 @@ async def main():
7171
"github": {
7272
"url": "https://api.githubcopilot.com/mcp/",
7373
"transport": "streamable_http",
74-
"headers": {"Authorization": f"Bearer {os.getenv('GITHUB_TOKEN', '')}"},
74+
"headers": {"Authorization": f"Bearer {os.environ['GITHUB_TOKEN']}"},
7575
}
7676
}
7777
)
@@ -85,8 +85,10 @@ async def main():
8585
prompt = f.read()
8686
agent = create_agent(base_model, prompt=prompt, tools=filtered_tools, response_format=IssueProposal)
8787

88-
user_content = "Find an issue from Azure-samples azure-search-openai-demo that can be closed."
89-
async for step in agent.astream({"messages": [HumanMessage(content=user_content)]}, stream_mode="updates"):
88+
user_content = "Find an open issue from Azure-samples azure-search-openai-demo that can be closed."
89+
async for step in agent.astream(
90+
{"messages": [HumanMessage(content=user_content)]}, stream_mode="updates", config={"recursion_limit": 100}
91+
):
9092
for step_name, step_data in step.items():
9193
last_message = step_data["messages"][-1]
9294
if isinstance(last_message, AIMessage) and last_message.tool_calls:

examples/triager.prompt.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Issue Triager
33

44
You are a GitHub issue triage specialist tasked with finding an old stale issue from a GitHub repository and determining whether it can be closed.
5+
YOU HAVE A BUDGET OF 6 TOOL CALLS TOTAL to research the issue and the repository codebase. Use them wisely.
56

67
## Steps
78

@@ -11,7 +12,7 @@ You are a GitHub issue triage specialist tasked with finding an old stale issue
1112
- Issue description and problem reported
1213
- Comments and any attempted solutions
1314
- Current relevance to the codebase
14-
3. **Search docs and repo**: Search the codebase (using search code tool and get file tool from GitHub MCP server) to see if code has changed in a way that resolves the issue. DO NOT make more than 8 tool calls total when doing research.
15+
3. **Search docs and repo**: Search the codebase (using search code tool and get file tool from GitHub MCP server) to see if code has changed in a way that resolves the issue. DO NOT make more than 6 tool calls total when doing research.
1516
4. **Categorize obsolescence**: Identify issues that are obsolete due to:
1617
- Infrastructure/deployment changes since the issue was reported
1718
- Migration to newer libraries/frameworks (e.g., OpenAI SDK updates)
@@ -28,7 +29,7 @@ When you search the repository code to judge whether an issue is already resolve
2829
3. Narrow with `path:` and/or `extension:` whenever possible for relevance and speed.
2930
4. Combine exactly one content term (or quoted phrase) with qualifiers. Example: `repo:Azure-Samples/example-repo path:src "search_client"`.
3031
5. Qualifiers-only queries (to list files) are allowed: `repo:Azure-Samples/example-repo path:scripts extension:sh`.
31-
6. Enforce the total research budget (max 8 tool calls). Plan the minimal ordered list of single-term queries before executing.
32+
6. Enforce the total research budget (max 6 tool calls). Plan the minimal ordered list of single-term queries before executing.
3233
7. Provide plain text; the tool layer URL-encodes automatically.
3334
8. Avoid line numbers (`file.py:123`) or unrelated tokens—they are not supported.
3435
9. If a query unexpectedly fails (rare with this simplified pattern), simplify further: remove lowest-value qualifier (except `repo:`) or choose an alternative synonym.

infra/main.bicep

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,7 @@ output AZURE_TENANT_ID string = tenant().tenantId
149149
output AZURE_RESOURCE_GROUP string = resourceGroup.name
150150

151151
// Specific to Azure OpenAI
152-
output AZURE_OPENAI_SERVICE string = openAi.outputs.name
153152
output AZURE_OPENAI_ENDPOINT string = openAi.outputs.endpoint
154-
155153
output AZURE_OPENAI_CHAT_MODEL string = gptModelName
156154
output AZURE_OPENAI_CHAT_DEPLOYMENT string = gptDeploymentName
157155
output AZURE_OPENAI_EMBEDDING_MODEL string = embeddingModelName

infra/main.parameters.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@
1313
},
1414
"runningOnGitHub": {
1515
"value": "${GITHUB_ACTIONS}"
16+
},
17+
"gptModelName": {
18+
"value": "${AZURE_GPT_MODEL_NAME}"
19+
},
20+
"gptModelVersion": {
21+
"value": "${AZURE_GPT_MODEL_VERSION}"
22+
},
23+
"gptDeploymentName": {
24+
"value": "${AZURE_GPT_DEPLOYMENT_NAME}"
25+
},
26+
"gptDeploymentCapacity": {
27+
"value": "${AZURE_GPT_DEPLOYMENT_CAPACITY}"
1628
}
1729
}
1830
}

infra/write_dot_env.ps1

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Set-Content -Path .env -Value ""
33

44
# Append new values to the .env file
55
$azureTenantId = azd env get-value AZURE_TENANT_ID
6-
$azureOpenAiService = azd env get-value AZURE_OPENAI_SERVICE
76
$azureOpenAiEndpoint = azd env get-value AZURE_OPENAI_ENDPOINT
87
$azureOpenAiChatDeployment = azd env get-value AZURE_OPENAI_CHAT_DEPLOYMENT
98
$azureOpenAiChatModel = azd env get-value AZURE_OPENAI_CHAT_MODEL
@@ -12,7 +11,6 @@ $azureOpenAiEmbeddingModel = azd env get-value AZURE_OPENAI_EMBEDDING_MODEL
1211

1312
Add-Content -Path .env -Value "API_HOST=azure"
1413
Add-Content -Path .env -Value "AZURE_TENANT_ID=$azureTenantId"
15-
Add-Content -Path .env -Value "AZURE_OPENAI_SERVICE=$azureOpenAiService"
1614
Add-Content -Path .env -Value "AZURE_OPENAI_ENDPOINT=$azureOpenAiEndpoint"
1715
Add-Content -Path .env -Value "AZURE_OPENAI_VERSION=2024-10-21"
1816
Add-Content -Path .env -Value "AZURE_OPENAI_CHAT_DEPLOYMENT=$azureOpenAiChatDeployment"

infra/write_dot_env.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# Append new values to the .env file
77
echo "API_HOST=azure" >> .env
88
echo "AZURE_TENANT_ID=$(azd env get-value AZURE_TENANT_ID)" >> .env
9-
echo "AZURE_OPENAI_SERVICE=$(azd env get-value AZURE_OPENAI_SERVICE)" >> .env
109
echo "AZURE_OPENAI_ENDPOINT=$(azd env get-value AZURE_OPENAI_ENDPOINT)" >> .env
1110
echo "AZURE_OPENAI_VERSION=2024-10-21" >> .env
1211
echo "AZURE_OPENAI_CHAT_DEPLOYMENT=$(azd env get-value AZURE_OPENAI_CHAT_DEPLOYMENT)" >> .env

0 commit comments

Comments
 (0)