Skip to content

    v2_post_passages_search

    Find passages in a brand's content before selecting sources for a draft. Provide the brand ID and the query text.

    See the REST reference for POST /v2/passages/search.

    Signature

    v2_post_passages_search(
        body: Mapping[str, Any],
    ) -> Response[Any]

    Parameters

    body
    Dictionary for the selected operation. See the REST reference for its required fields.

    Return value

    Read the matched passages in response.data. Each passage result includes its passage ID, text and location in the source.

    Errors

    • AeoApiError includes the HTTP status, error code and request ID. An invalid key raises UnauthenticatedError. Check the key’s scopes if you receive ForbiddenError.
    • Invalid arguments can raise ValueError or TypeError before the SDK sends a request.
    • AeoTransportError means the request could not reach the API after any allowed retries, or the response could not be read as JSON.

    Python example

    import os
    from aeo_sdk import AeoClient
    
    with AeoClient(os.environ["AEO_API_KEY"], base_url=os.environ["AEO_API_BASE_URL"]) as client:
        response = client.v2_post_passages_search(
            body={
                'brand_id': '00000000-0000-4000-8000-000000000001',
                'query': 'product documentation',
            },
        )
        print(response.body)

    Async example

    import asyncio
    import os
    from aeo_sdk import AsyncAeoClient
    
    async def main():
        async with AsyncAeoClient(os.environ["AEO_API_KEY"], base_url=os.environ["AEO_API_BASE_URL"]) as client:
            response = await client.v2_post_passages_search(
                body={
                    'brand_id': '00000000-0000-4000-8000-000000000001',
                    'query': 'product documentation',
                },
            )
            print(response.body)
    
    asyncio.run(main())

    Requests by feature

    Retrieval simulator and content testing

    See Python client setup for the environment variables, response properties and retry settings.