Skip to content
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
a2230cd
use azsdk azp tool to analyze pipeline
Nov 7, 2025
b3834ed
azsdkcli support ManagedIdentityCredential
Nov 7, 2025
52731c4
optimize docker file
Nov 7, 2025
fa7025a
fix dockerfile
Nov 7, 2025
b45b0d6
resolve dockerfile
Nov 7, 2025
eb25c22
decode html content
Nov 10, 2025
37680b8
use buildID
Nov 10, 2025
db9c430
update test
Nov 10, 2025
1db392e
adjust the order of MI
Nov 14, 2025
2f640bc
add general tenant config
Nov 18, 2025
0125355
fix bug for routing tenant
Nov 18, 2025
9131cba
refine route tenant prompt
Dec 3, 2025
b55843d
fix route tenant bug
Dec 3, 2025
c632c55
Merge branch 'main' into feature/access_pipeline_log
Dec 5, 2025
6b35004
Merge branch 'main' into feature/access_pipeline_log
Dec 10, 2025
11044a2
merge main
Dec 10, 2025
bd4608e
update code
Dec 10, 2025
79e057e
Merge branch 'main' into feature/access_pipeline_log
Dec 16, 2025
9cf772c
analyze pipeline log
Dec 16, 2025
2130e4e
update changelog
Dec 16, 2025
5afc464
refine prompt
Dec 16, 2025
f517823
resolve comments
Dec 16, 2025
29e20cc
fix ci failure
Dec 16, 2025
1f6fd18
update
Dec 16, 2025
dedc728
use agentic search prompt parser
Dec 16, 2025
a881e0d
update prompt
Dec 16, 2025
fea4d85
update prompt
Dec 16, 2025
4453776
resolve comments
Dec 16, 2025
3ccf98c
resolve comment
Dec 17, 2025
d97249a
update image
Dec 17, 2025
50c5c3c
Merge branch 'access_pipeline_log' into feature/access_pipeline_log
Dec 18, 2025
88ee650
refine prompt
Dec 18, 2025
ffaecf8
upload test result
Dec 18, 2025
52485ed
update test result
Dec 18, 2025
095bace
Merge branch 'main' into feature/access_pipeline_log
Dec 22, 2025
e557b5b
evaluation
Dec 22, 2025
5628f99
add js and java tenant
Dec 22, 2025
3b7bf5c
refine knowledge sync process
Dec 22, 2025
3c4f3a5
update general tenant config
Dec 23, 2025
dd705db
support link
Dec 23, 2025
c2b92cd
fix knowledge sync
Dec 23, 2025
5630f9b
fix config
Dec 23, 2025
2835f27
fix
Dec 23, 2025
a7905cf
fix config
Dec 23, 2025
c10fcc6
update tenant config
Dec 23, 2025
9356fe2
update
Dec 25, 2025
d7ecb15
Merge branch 'main' into feature/access_pipeline_log
Jan 5, 2026
1abf28d
add dotnet knowledge
Jan 6, 2026
895273a
update dotnet config
Jan 6, 2026
ae6fd3e
add dotnet knowledge
Jan 6, 2026
c9f8185
update intention prompt
Jan 6, 2026
4a11bcb
refactor chunk post process logic
Jan 6, 2026
d999ba6
update prompt
Jan 6, 2026
706444a
update
Jan 7, 2026
d91ed3a
Merge branch 'main' into feature/access_pipeline_log
Jan 7, 2026
a19bc49
update
Jan 7, 2026
b069dbf
return routed tenant
Jan 8, 2026
809498c
Merge branch 'main' into feature/access_pipeline_log
Jan 8, 2026
2f312be
solve comments
Jan 8, 2026
c768d4a
update changelog
Jan 8, 2026
87c23be
update config
Jan 8, 2026
028eb6d
remove unreliable test case
Jan 8, 2026
e4e83d5
update prompt
Jan 9, 2026
cc5c466
update prompt
Jan 9, 2026
5fed992
update routing prompt
Jan 13, 2026
c8fdbf8
refine prompt
Jan 13, 2026
a812828
extract prompt template
Jan 13, 2026
616a9b4
update test
Jan 13, 2026
64dd3fc
fix badcase
Jan 13, 2026
fed721d
add license header
Jan 13, 2026
5922e48
make topK configurable
Jan 13, 2026
0b8c0ee
add description for mergeAndProcessSearchResults
Jan 13, 2026
64e2936
update
Jan 14, 2026
6cce855
control model temperature
Jan 14, 2026
e9f6316
remove full file strategy
Jan 14, 2026
3d2ce46
update prompt
Jan 14, 2026
003e7a6
fix bug for deduplicate expansions logic
Jan 15, 2026
94462ef
Revert "update prompt"
Jan 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 53 additions & 6 deletions tools/sdk-ai-bots/azure-sdk-qa-bot-backend/config/tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type TenantConfig struct {
AgenticSearchPrompt string
IntentionPromptTemplate string
KeywordReplaceMap map[string]string
EnableRouting bool
}

var typespecSources = []model.Source{
Expand Down Expand Up @@ -41,18 +42,48 @@ var tenantConfigMap = map[model.TenantID]TenantConfig{
IntentionPromptTemplate: "language_python/intention.md",
AgenticSearchPrompt: "language_python/agentic_search.md",
},
model.TenantID_DotnetChannelQaBot: {
Sources: append([]model.Source{model.Source_AzureSDKForNetDocs, model.Source_AzureSDKGuidelines, model.Source_AzureSDKDocsEng}, typespecSources...),
SourceFilter: map[model.Source]string{
model.Source_AzureSDKGuidelines: "search.ismatch('dotnet_*', 'title')",
},
PromptTemplate: "language_channel/qa.md",
IntentionPromptTemplate: "language_channel/intention.md",
AgenticSearchPrompt: "language_channel/agentic_search.md",
},
model.TenantID_GolangChannelQaBot: {
Sources: append([]model.Source{model.Source_AzureSDKForGo, model.Source_AzureSDKGuidelines}, typespecSources...),
Sources: append([]model.Source{model.Source_AzureSDKForGo, model.Source_AzureSDKGuidelines, model.Source_AzureSDKDocsEng}, typespecSources...),
SourceFilter: map[model.Source]string{
model.Source_AzureSDKGuidelines: "search.ismatch('golang_*', 'title')",
},
PromptTemplate: "common/language_channel.md",
IntentionPromptTemplate: "prompt_template/intention.md",
AgenticSearchPrompt: "common/agentic_search.md",
PromptTemplate: "language_channel/qa.md",
IntentionPromptTemplate: "language_channel/intention.md",
AgenticSearchPrompt: "language_channel/agentic_search.md",
},
model.TenantID_JavaChannelQaBot: {
Sources: append([]model.Source{model.Source_AzureSDKForJava, model.Source_AzureSDKForJavaWiki, model.Source_AzureSDKGuidelines, model.Source_AutorestJava, model.Source_AzureSDKDocsEng}, typespecSources...),
SourceFilter: map[model.Source]string{
model.Source_AzureSDKGuidelines: "search.ismatch('java_*', 'title')",
},
PromptTemplate: "language_channel/qa.md",
IntentionPromptTemplate: "language_channel/intention.md",
AgenticSearchPrompt: "language_channel/agentic_search.md",
},
model.TenantID_JavaScriptChannelQaBot: {
Sources: append([]model.Source{model.Source_AzureSDKForJavaScript, model.Source_AzureSDKForJavaScriptWiki, model.Source_AzureSDKGuidelines, model.Source_AzureSDKDocsEng}, typespecSources...),
SourceFilter: map[model.Source]string{
model.Source_AzureSDKGuidelines: "search.ismatch('typescript_*', 'title')",
},
PromptTemplate: "language_channel/qa.md",
IntentionPromptTemplate: "language_channel/intention.md",
AgenticSearchPrompt: "language_channel/agentic_search.md",
},
model.TenantID_AzureSDKQaBot: {
PromptTemplate: "typespec/qa.md",
Sources: typespecSources,
PromptTemplate: "typespec/qa.md",
Sources: append(typespecSources, model.Source_AzureSDKDocsEng),
SourceFilter: map[model.Source]string{
model.Source_AzureSDKDocsEng: "search.ismatch('design*', 'title')",
},
IntentionPromptTemplate: "typespec/intention.md",
AgenticSearchPrompt: "typespec/agentic_search.md",
},
Expand All @@ -62,6 +93,22 @@ var tenantConfigMap = map[model.TenantID]TenantConfig{
AgenticSearchPrompt: "azure_sdk_onboarding/agentic_search.md",
IntentionPromptTemplate: "azure_sdk_onboarding/intention.md",
},
model.TenantID_GeneralQaBot: {
PromptTemplate: "general/qa.md",
IntentionPromptTemplate: "general/intention.md",
AgenticSearchPrompt: "general/agentic_search.md",
EnableRouting: true,
},
model.TenantID_APISpecReviewBot: {
PromptTemplate: "api_spec_review/qa.md",
Sources: []model.Source{model.Source_StaticAzureDocs, model.Source_AzureRestAPISpec, model.Source_AzureSDKDocsEng},
SourceFilter: map[model.Source]string{
model.Source_AzureSDKDocsEng: "search.ismatch('design*', 'title')",
},
IntentionPromptTemplate: "api_spec_review/intention.md",
AgenticSearchPrompt: "api_spec_review/agentic_search.md",
EnableRouting: true,
},
}

func GetTenantConfig(tenantID model.TenantID) (TenantConfig, bool) {
Expand Down
26 changes: 21 additions & 5 deletions tools/sdk-ai-bots/azure-sdk-qa-bot-backend/model/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ package model
type TenantID string

const (
TenantID_AzureSDKQaBot TenantID = "azure_sdk_qa_bot" // default as TypeSpec QA bot
TenantID_TypeSpecExtension TenantID = "typespec_extension"
TenantID_PythonChannelQaBot TenantID = "python_channel_qa_bot"
TenantID_AzureSDKOnboarding TenantID = "azure_sdk_onboarding"
TenantID_GolangChannelQaBot TenantID = "golang_channel_qa_bot"
TenantID_AzureSDKQaBot TenantID = "azure_sdk_qa_bot" // default as TypeSpec QA bot
TenantID_TypeSpecExtension TenantID = "typespec_extension"
TenantID_PythonChannelQaBot TenantID = "python_channel_qa_bot"
TenantID_DotnetChannelQaBot TenantID = "dotnet_channel_qa_bot"
TenantID_AzureSDKOnboarding TenantID = "azure_sdk_onboarding"
TenantID_GolangChannelQaBot TenantID = "golang_channel_qa_bot"
TenantID_JavaChannelQaBot TenantID = "java_channel_qa_bot"
TenantID_JavaScriptChannelQaBot TenantID = "javascript_channel_qa_bot"
TenantID_GeneralQaBot TenantID = "general_qa_bot"
TenantID_APISpecReviewBot TenantID = "api_spec_review_bot"
)

type Source string
Expand All @@ -29,6 +34,12 @@ const (
Source_AzureSDKForGo Source = "azure_sdk_for_go_docs"
Source_StaticAzureDocs Source = "static_azure_docs"
Source_StaticTypeSpecToSwaggerMapping Source = "static_typespec_to_swagger_mapping"
Source_AzureSDKForJava Source = "azure_sdk_for_java_docs"
Source_AzureSDKForJavaWiki Source = "azure_sdk_for_java_wiki"
Source_AutorestJava Source = "autorest_java_docs"
Source_AzureSDKForJavaScript Source = "azure_sdk_for_js_docs"
Source_AzureSDKForJavaScriptWiki Source = "azure_sdk_for_js_wiki"
Source_AzureSDKForNetDocs Source = "azure_sdk_for_net_docs"
)

type Role string
Expand Down Expand Up @@ -85,6 +96,7 @@ type CompletionResp struct {
FullContext *string `json:"full_context" jsonschema:"omitempty,description=The full context used to generate the answer"`
Intention *IntentionResult `json:"intention" jsonschema:"omitempty,description=The intention of the question"`
ReasoningProgress *string `json:"reasoning_progress,omitempty" jsonschema:"omitempty,description=The reasoning progress of generating the answer"`
RouteTenant *TenantID `json:"route_tenant,omitempty" jsonschema:"omitempty,description=The tenant ID the question is routed to"`
}

type QuestionScope string
Expand All @@ -102,3 +114,7 @@ type IntentionResult struct {
Scope QuestionScope `json:"scope,omitempty" jsonschema:"omitempty,description=The scope of the question"`
NeedsRagProcessing bool `json:"needs_rag_processing" jsonschema:"required,description=Whether to invoke RAG workflow"`
}

type TenantRoutingResult struct {
RouteTenant TenantID `json:"route_tenant" jsonschema:"required,description=The tenant ID to route the question to"`
}
41 changes: 41 additions & 0 deletions tools/sdk-ai-bots/azure-sdk-qa-bot-backend/model/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,33 @@ import (
"strings"
)

// ExpansionType defines how a chunk should be expanded
type ExpansionType int

const (
ExpansionNone ExpansionType = iota // No expansion needed - use chunk as-is
ExpansionFullFile // Expand entire file using CompleteChunk
ExpansionHierarchical // Expand based on header hierarchy
ExpansionQA // Expand based on Q&A pairs
ExpansionMapping // Expand based on TypeSpec to Swagger mapping
)

// ChunkWithExpansion wraps a chunk with its expansion strategy
type ChunkWithExpansion struct {
Chunk Index
Expansion ExpansionType
}

// ChunkHierarchy represents the header level of a chunk
type ChunkHierarchy int

const (
HierarchyHeader3 ChunkHierarchy = iota // Full chunk with header3 (most specific)
HierarchyHeader2 // Chunk with header1 and header2
HierarchyHeader1 // Chunk with only header1
HierarchyUnknown // Unknown or no headers
)

type AgenticSearchRequest struct {
Messages []KnowledgeAgentMessage `json:"messages"`
KnowledgeSourceParams []KnowledgeSourceParams `json:"knowledgeSourceParams,omitempty"`
Expand Down Expand Up @@ -247,11 +274,25 @@ func GetIndexLink(chunk Index) string {
return "https://azure.github.io/typespec-azure/docs/migrate-swagger/faq/breakingchange"
case Source_AzureSDKForGo:
return "https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/" + path
case Source_AzureSDKForJava:
return "https://github.com/Azure/azure-sdk-for-java/blob/main/" + path
case Source_AzureSDKForJavaWiki:
path = TrimFileFormat(path)
return "https://github.com/Azure/azure-sdk-for-java/wiki/" + path
case Source_AutorestJava:
return "https://github.com/Azure/autorest.java/blob/main/" + path
case Source_StaticAzureDocs:
if chunk.Title == "Azure Versioning and Breaking Changes Policy V1.3.2" {
return "http://aka.ms/azbreakingchangespolicy"
}
return ""
case Source_AzureSDKForJavaScript:
return "https://github.com/Azure/azure-sdk-for-js/blob/main/" + path
case Source_AzureSDKForJavaScriptWiki:
path = TrimFileFormat(path)
return "https://github.com/Azure/azure-sdk-for-js/wiki/" + path
case Source_AzureSDKForNetDocs:
return "https://github.com/Azure/azure-sdk-for-net/blob/main/" + path
default:
return ""
}
Expand Down
Loading
Loading