AI Search output unrelated responses

桂學文 Kevin Kuei 155 信譽積分
2025-12-01T07:44:19.7533333+00:00

I'm using AI Search to perform vector indexing on two simple PDF files (stored in blob storage). Then I tried to use the search explorer to query for content that doesn't exist in the PDFs.

For example: "Tsai Ing-wen's birthday"

However, the Results still output some content, and this content is completely irrelevant to the question.

How can I solve this? Can I require it to explicitly say "not found" if it can't find an answer, instead of giving irrelevant responses?

Thank you.

Azure AI 搜尋服務
Azure AI 搜尋服務
具有內建人工智慧功能的 Azure 搜尋服務,可擴充資訊,以協助大規模識別並探索相關內容。
{count} 票

1 個答案

排序方式: 有幫助
  1. 桂學文 Kevin Kuei 155 信譽積分
    2025-12-04T08:26:07.9733333+00:00

    I'm using Azure Ai Search as a tool. Can you tell me how to configure a @search.score threshold?

    ai_search = AzureAISearchTool(

    index_connection_id=conn_id,
    
    index_name=index_name,
    
    query_type=AzureAISearchQueryType.VECTOR_SEMANTIC_HYBRID,
    
    top_k=6,
    

    )

    Create agent with AI search tool and process agent run

    with agents_client:

    agent = agents_client.create_agent(
    
        model="gpt-4o",
    
        name="agent-sdk-kk-with-ai-search",
    
        instructions="...",
    
        tools=ai_search.definitions,
    
        tool_resources=ai_search.resources,
    
    )
    
    
    
    thread = agents_client.threads.create()
    
    message = agents_client.messages.create(
    
        thread_id=thread.id,
    
        role="user",
    
        content="Tell me something about ....."
    
    )
    

您的答案

問題作者可以將答案標記為「接受的答案」和審查員「推薦的答案」,協助使用者了解哪些答案解決作者的問題。