> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs-staging.you.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs-staging.you.com/_mcp/server.

# Advanced Agent

POST https://api.you.com/v1/agents/runs
Content-Type: application/json

This endpoint answers the user’s query with an LLM. Optionally, you can ground the answer using web results (max 1 web search).

Use it for answering simple questions that require a low latency response.

The data returns as SSE (Server-Side Events) with the `text/event-stream` content type in the response header. It streams data in while the agent is responding.

Reference: https://docs-staging.you.com/docs/custom-solutions/agents/advanced-agent/advanced-agent-runs

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: advanced
  version: 1.0.0
paths:
  /v1/agents/runs:
    post:
      operationId: advanced-agent-runs-stream
      summary: Advanced Agent
      description: >-
        This endpoint answers the user’s query with an LLM. Optionally, you can
        ground the answer using web results (max 1 web search).


        Use it for answering simple questions that require a low latency
        response.


        The data returns as SSE (Server-Side Events) with the
        `text/event-stream` content type in the response header. It streams data
        in while the agent is responding.
      tags:
        - ''
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            text/event-stream:
              schema:
                $ref: '#/components/schemas/type_:AdvancedAgentRunsStreamingResponse'
        '401':
          description: The Authorization Bearer token was missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_:AgentRuns401Response'
        '422':
          description: When the request data coming in is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_:AgentRuns422Response'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                agent:
                  $ref: >-
                    #/components/schemas/type_:AdvancedAgentRunsStreamRequestAgent
                  description: >-
                    Setting this value to "advanced" is mandatory to use the
                    advanced agent.
                input:
                  type: string
                  description: The question you'd like to ask the agent
                stream:
                  type: boolean
                  enum:
                    - true
                  description: >-
                    Must be set to `true` when you want to stream the agent
                    response as its being generated, and `false` when you want
                    the response to return after the agent has finished.
                tools:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/type_:AdvancedAgentRunsStreamRequestToolsItem
                  description: >-
                    The advanced agent accepts either `compute` or `research`
                    tools <Note> Compute allows your agent to use a Python code
                    interpreter for tasks such as data analysis, mathematical
                    calculations, and plot generation.<br><br> Research
                    iteratively searches the web, analyzes the results, and
                    stops when finished. It then provides a comprehensive report
                    to your agent with current, cited information.</Note>
                verbosity:
                  $ref: >-
                    #/components/schemas/type_:AdvancedAgentRunsStreamRequestVerbosity
                  description: >-
                    Controls the level of detail provided by the agent's
                    response. Choosing high maps to a long-form report while
                    medium maps to a medium verbosity report that captures most
                    details but is less comprehensive.
                workflow_config:
                  $ref: >-
                    #/components/schemas/type_:AdvancedAgentRunsStreamRequestWorkflowConfig
                  description: >-
                    Defines the maximum number of steps the agent uses in its
                    workflow plan to answer your query. Higher values allow for
                    more tool calls, but it takes longer for the agent to
                    provide the response. For instance, setting
                    max_workflow_steps=5 could allow the agent to call the
                    research tool 3 times and the compute tool 2 times.
              required:
                - agent
                - input
                - stream
servers:
  - url: https://api.you.com
    description: Production
components:
  schemas:
    type_:AdvancedAgentRunsStreamRequestAgent:
      type: string
      enum:
        - advanced
      description: Setting this value to "advanced" is mandatory to use the advanced agent.
      title: AdvancedAgentRunsStreamRequestAgent
    type_:AdvancedAgentRunsStreamRequestToolsItemResearchSearchEffort:
      type: string
      enum:
        - auto
        - low
        - medium
        - high
      description: >-
        This parameter maps to different configurations regarding the depth of
        research the tool can perform. Its values range from `low`, `medium` to
        `high`.


        Alternatively, use `auto` mode for a more dynamic search approach,
        allowing the tool the freedom to adjust its subparameters.
      title: AdvancedAgentRunsStreamRequestToolsItemResearchSearchEffort
    type_:AdvancedAgentRunsStreamRequestToolsItemResearchReportVerbosity:
      type: string
      enum:
        - medium
        - high
      description: Select whether to receive a medium or high length model response.
      title: AdvancedAgentRunsStreamRequestToolsItemResearchReportVerbosity
    type_:AdvancedAgentRunsStreamRequestToolsItem:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - compute
              description: 'Discriminator value: compute'
          required:
            - type
        - type: object
          properties:
            type:
              type: string
              enum:
                - research
              description: 'Discriminator value: research'
            search_effort:
              $ref: >-
                #/components/schemas/type_:AdvancedAgentRunsStreamRequestToolsItemResearchSearchEffort
              description: >-
                This parameter maps to different configurations regarding the
                depth of research the tool can perform. Its values range from
                `low`, `medium` to `high`.


                Alternatively, use `auto` mode for a more dynamic search
                approach, allowing the tool the freedom to adjust its
                subparameters.
            report_verbosity:
              $ref: >-
                #/components/schemas/type_:AdvancedAgentRunsStreamRequestToolsItemResearchReportVerbosity
              description: >-
                Select whether to receive a medium or high length model
                response.
          required:
            - type
            - search_effort
            - report_verbosity
      discriminator:
        propertyName: type
      title: AdvancedAgentRunsStreamRequestToolsItem
    type_:AdvancedAgentRunsStreamRequestVerbosity:
      type: string
      enum:
        - medium
        - high
      description: >-
        Controls the level of detail provided by the agent's response. Choosing
        high maps to a long-form report while medium maps to a medium verbosity
        report that captures most details but is less comprehensive.
      title: AdvancedAgentRunsStreamRequestVerbosity
    type_:AdvancedAgentRunsStreamRequestWorkflowConfig:
      type: object
      properties:
        max_workflow_steps:
          type: integer
          default: 10
      required:
        - max_workflow_steps
      description: >-
        Defines the maximum number of steps the agent uses in its workflow plan
        to answer your query. Higher values allow for more tool calls, but it
        takes longer for the agent to provide the response. For instance,
        setting max_workflow_steps=5 could allow the agent to call the research
        tool 3 times and the compute tool 2 times.
      title: AdvancedAgentRunsStreamRequestWorkflowConfig
    type_:ResponseCreatedType:
      type: string
      enum:
        - response.created
      title: ResponseCreatedType
    type_:ResponseStartingType:
      type: string
      enum:
        - response.starting
      title: ResponseStartingType
    type_:ResponseOutputItemAddedType:
      type: string
      enum:
        - response.output_item.added
      title: ResponseOutputItemAddedType
    type_:ResponseOutputItemAddedResponse:
      type: object
      properties:
        output_index:
          type: integer
          description: The index of the output item in the response
      required:
        - output_index
      title: ResponseOutputItemAddedResponse
    type_:ResponseOutputContentFullType:
      type: string
      enum:
        - response.output_content.full
      title: ResponseOutputContentFullType
    type_:ResponseOutputContentFullResponseType:
      type: string
      enum:
        - web_search.results
      title: ResponseOutputContentFullResponseType
    type_:AgentRunsResponseWebSearchResultSourceType:
      type: string
      enum:
        - web_search
      description: The type of content the agent can return outside a text response
      title: AgentRunsResponseWebSearchResultSourceType
    type_:AgentRunsResponseWebSearchResult:
      type: object
      properties:
        source_type:
          $ref: >-
            #/components/schemas/type_:AgentRunsResponseWebSearchResultSourceType
          description: The type of content the agent can return outside a text response
        citation_uri:
          type: string
          description: The web search result the agent returned along in its response
        provider:
          type: string
          description: This is currently unused
        title:
          type: string
          description: The title of the web site returned under url
        snippet:
          type: string
          description: A textual portion of the web site returned under url
        thumbnail_url:
          type: string
          description: The thumbnail image of the url
        url:
          type: string
          description: The web search result the agent returned along in its response
      required:
        - source_type
        - citation_uri
        - title
        - snippet
        - url
      description: >-
        The text response of the agent. This field only returns when the type is
        `web_search.results`
      title: AgentRunsResponseWebSearchResult
    type_:ResponseOutputContentFullResponse:
      type: object
      properties:
        output_index:
          type: integer
        type:
          $ref: '#/components/schemas/type_:ResponseOutputContentFullResponseType'
        full:
          type: array
          items:
            $ref: '#/components/schemas/type_:AgentRunsResponseWebSearchResult'
          description: Complete web search results
      required:
        - output_index
        - type
        - full
      title: ResponseOutputContentFullResponse
    type_:ResponseOutputItemDoneType:
      type: string
      enum:
        - response.output_item.done
      title: ResponseOutputItemDoneType
    type_:ResponseOutputItemDoneResponse:
      type: object
      properties:
        output_index:
          type: integer
      required:
        - output_index
      title: ResponseOutputItemDoneResponse
    type_:ResponseOutputTextDeltaType:
      type: string
      enum:
        - response.output_text.delta
      title: ResponseOutputTextDeltaType
    type_:ResponseOutputTextDeltaResponseType:
      type: string
      enum:
        - message.answer
      title: ResponseOutputTextDeltaResponseType
    type_:ResponseOutputTextDeltaResponse:
      type: object
      properties:
        output_index:
          type: integer
        type:
          $ref: '#/components/schemas/type_:ResponseOutputTextDeltaResponseType'
        delta:
          type: string
          description: Incremental text content
      required:
        - output_index
        - type
        - delta
      title: ResponseOutputTextDeltaResponse
    type_:ResponseDoneType:
      type: string
      enum:
        - response.done
      title: ResponseDoneType
    type_:ResponseDoneResponse:
      type: object
      properties:
        run_time_ms:
          type: string
          description: Total runtime in milliseconds
        finished:
          type: boolean
          description: Whether the response is complete
      required:
        - run_time_ms
        - finished
      title: ResponseDoneResponse
    type_:AdvancedAgentRunsStreamingResponse:
      oneOf:
        - type: object
          properties:
            type:
              $ref: '#/components/schemas/type_:ResponseCreatedType'
            seq_id:
              type: integer
          required:
            - type
            - seq_id
        - type: object
          properties:
            type:
              $ref: '#/components/schemas/type_:ResponseStartingType'
            seq_id:
              type: integer
          required:
            - type
            - seq_id
        - type: object
          properties:
            type:
              $ref: '#/components/schemas/type_:ResponseOutputItemAddedType'
            seq_id:
              type: integer
            response:
              $ref: '#/components/schemas/type_:ResponseOutputItemAddedResponse'
          required:
            - type
            - seq_id
            - response
        - type: object
          properties:
            type:
              $ref: '#/components/schemas/type_:ResponseOutputContentFullType'
            seq_id:
              type: integer
            response:
              $ref: '#/components/schemas/type_:ResponseOutputContentFullResponse'
          required:
            - type
            - seq_id
            - response
        - type: object
          properties:
            type:
              $ref: '#/components/schemas/type_:ResponseOutputItemDoneType'
            seq_id:
              type: integer
            response:
              $ref: '#/components/schemas/type_:ResponseOutputItemDoneResponse'
          required:
            - type
            - seq_id
            - response
        - type: object
          properties:
            type:
              $ref: '#/components/schemas/type_:ResponseOutputTextDeltaType'
            seq_id:
              type: integer
            response:
              $ref: '#/components/schemas/type_:ResponseOutputTextDeltaResponse'
          required:
            - type
            - seq_id
            - response
        - type: object
          properties:
            type:
              $ref: '#/components/schemas/type_:ResponseDoneType'
            seq_id:
              type: integer
            response:
              $ref: '#/components/schemas/type_:ResponseDoneResponse'
          required:
            - type
            - seq_id
            - response
      discriminator:
        propertyName: type
      description: Server-Sent Event (SSE) format for streaming agent responses
      title: AdvancedAgentRunsStreamingResponse
    type_:AgentRuns401Response:
      type: object
      properties:
        detail:
          type: string
      description: The message returned by the error
      title: AgentRuns401Response
    type_:AgentRuns422ResponseDetailItemLocItem:
      oneOf:
        - type: string
        - type: integer
      title: AgentRuns422ResponseDetailItemLocItem
    type_:AgentRuns422ResponseDetailItem:
      type: object
      properties:
        type:
          type: string
        loc:
          type: array
          items:
            $ref: '#/components/schemas/type_:AgentRuns422ResponseDetailItemLocItem'
        msg:
          type: string
        input:
          type: string
      required:
        - type
        - loc
        - msg
        - input
      title: AgentRuns422ResponseDetailItem
    type_:AgentRuns422Response:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/type_:AgentRuns422ResponseDetailItem'
      title: AgentRuns422Response
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## Examples

**Request**

```json
{
  "agent": "advanced",
  "input": "You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common sources and dosages of microplastics are. Highlight what a safe dosage might be and how to achieve it",
  "stream": true
}
```

**Response**

```text
event: response.created
data: {"seq_id":0,"type":"response.created"}

event: response.starting
data: {"seq_id":1,"type":"response.starting"}

event: response.output_item.added
data: {"seq_id":2,"type":"response.output_item.added","response":{"output_index":0}}

event: response.output_content.full
data: {"seq_id":3,"type":"response.output_content.full","response":{"output_index":0,"type":"web_search.results","full":[{"source_type":"web_search","citation_uri":"https://www.sciencedirect.com/science/article/abs/pii/S0301479725018912","title":"Microplastics as an emerging threat to human health: An overview of potential health impacts - ScienceDirect","snippet":"To provide a clear and transparent foundation for this review, we conducted a systematic search and analysis of the relevant scientific literature searched from multiple databases, including Web of Science, PubMed, ScienceDirect, China...","url":"https://www.sciencedirect.com/science/article/abs/pii/S0301479725018912#:~:text=To%20provide%20a%20clear,health%2C%20and%20their%20underlying","provider":null,"thumbnail_url":"https://imgs.you.com/-ZIpMRKJqV3PF_i-oob-q-p7b_TXVimtAjVYV_Kfa40/rs:fit:200:200:1:0/g:ce/aHR0cHM6Ly9hcnMu/ZWxzLWNkbi5jb20v/Y29udGVudC9pbWFn/ZS8xLXMyLjAtUzAz/MDE0Nzk3MjVYMDAx/M1gtY292MTUwaC5n/aWY.jpeg"},{"source_type":"web_search","citation_uri":"https://www.nature.com/articles/s41370-023-00634-x#:~:text=To%20fully%20understand%20the,in%20air%2C%20health%20impacts/effects","provider":null,"title":"Systematic review of microplastics and nanoplastics in indoor and outdoor air: identifying a framework and data needs for quantifying human inhalation exposures | Journal of Exposure Science & Environmental Epidemiology","snippet":"To fully understand the possible impacts of MPs on human health, it is necessary to quantify MP exposure and identify what critical data gaps exist. The current paper provides a human exposure assessment of microplastics in the air using systematically reviewed literature that provided concentration of MPs in air as well as doses used in toxicology studies to calculate inhalation exposure dose.\nHumans are likely exposed to microplastics (MPs) in a variety of places including indoor and outdoor air. Research to better understand how exposure to MPs correlates to health is growing. To fully understand the possible impacts of MPs on human health, it is necessary to quantify MP exposure and identify what critical data gaps exist.\nTo fully understand the possible impacts of MPs on human health, it is necessary to quantify MP exposure and identify what critical data gaps exist. The current paper provides a human exposure assessment of microplastics in the air using systematically reviewed literature that provided concentration of MPs in air as well as doses used in toxicology studies to calculate inhalation exposure dose.\nThe initial inclusion criteria for abstract screening were literature that included information about MPs in outdoor or indoor air (from now on referred to as *air*), human exposure to MPs in air, pathways of human exposure to MPs in air, health impacts/effects fr","thumbnail_url":"https://imgs.you.com/WcAkItsaQb3_BlMRzhL2LzEztqAgazk7mhI8KVQIt3Q/rs:fit:200:200:1:0/g:ce/aHR0cHM6Ly9tZWRp/YS5zcHJpbmdlcm5h/dHVyZS5jb20vbTY4/NS9zcHJpbmdlci1z/dGF0aWMvaW1hZ2Uv/YXJ0JTNBMTAuMTAz/OCUyRnM0MTM3MC0w/MjMtMDA2MzQteC9N/ZWRpYU9iamVjdHMv/NDEzNzBfMjAyM182/MzRfRmlnMV9IVE1M/LnBuZw","url":"https://www.nature.com/articles/s41370-023-00634-x#:~:text=To%20fully%20understand%20the,in%20air%2C%20health%20impacts/effects"},{"source_type":"web_search","citation_uri":"https://www.frontiersin.org/journals/environmental-science/articles/10.3389/fenvs.2025.1606332/full#:~:text=Adverse%20health%20effects%20linked,systematic%20review%20of%20the","provider":"null,","title":"Frontiers | A review of microplastic pollution and human health risk assessment: current knowledge and future outlook","snippet":"The Global Average Rate of Microplastic Ingestion (GARMI) is increasingly referenced to support risk assessment efforts related to MP pollution (Senathirajah et al., 2021). Therefore, this review consolidates current knowledge on microplastic (MP) concentrations in aquatic environments, their pathways of exposure, including ingestion, inhalation, and dermal contact, and the mechanisms underlying their toxicity.\nDeveloping standardized methods for characterizing, analyzing, quantifying, and assessing potential human health risks from microplastic pollution. • The implications of microplastic exposure on human health are profound, necessitating urgent attention from researchers, policymakers, and healthcare providers to develop strategies for mitigation and prevention. Understanding the mechanisms of toxicity is crucial for establishing effective public health guidelines and protective measures against this pervasive environmental issue.\nSocio-economic status also affects dietary habits and access to safe food and water, with disadvantaged populations more likely to consume contaminated sources and have less awareness of MP risks (Prata et al., 2020). These factors underscore the need for context-specific exposure assessments and interventions. There are several critical concerns raised by microplastics in aquatic ecosystems including envirnmental health effects, bioaccumulation, ecological eff","thumbnail_url":"https://imgs.you.com/vYsfI0InMCDjPJYRqSj0n8SapkmYY5HSSmD2nE4ooYw/rs:fit:200:200:1:0/g:ce/aHR0cHM6Ly9pbWFn/ZXMtcHJvdmlkZXIu/ZnJvbnRpZXJzaW4u/b3JnL2FwaS9pcHgv/dz0xMjAwJmY9cG5n/L2h0dHBzOi8vd3d3/LmZyb250aWVyc2lu/Lm9yZy9maWxlcy9B/cnRpY2xlcy8xNjA2/MzMyL2ZlbnZzLTEz/LTE2MDYzMzItSFRN/TC1yMS9pbWFnZV9t/L2ZlbnZzLTEzLTE2/MDYzMzItZzAwMS5q/cGc","url":"https://www.frontiersin.org/journals/environmental-science/articles/10.3389/fenvs.2025.1606332/full#:~:text=Adverse%20health%20effects%20linked,systematic%20review%20of%20the"},{"source_type":"web_search","citation_uri":"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC10902512/#:~:text=However%2C%20available%20evidence%20from,is%20needed%20to%20provide","provider":"null,","title":"A systematic review of the impacts of exposure to micro- and nano-plastics on human tissue accumulation and health - PMC","snippet":"However, available evidence from in vitro studies using human cells and in vivo studies using animal models, such as mice and rats, indicates that exposure to MNPs may induce inflammation, oxidative stress, cytotoxicity, and respiratory disease ...\nHowever, available evidence from in vitro studies using human cells and in vivo studies using animal models, such as mice and rats, indicates that exposure to MNPs may induce inflammation, oxidative stress, cytotoxicity, and respiratory disease [24,25]. Moreover, it is important to note that MNPs not only contain a range of plastic additives, including dyes, plasticizers, and antioxidants but also serve as carriers of persistent organic chemicals, heavy metals, and pathogenic microorganisms, all of which can be toxic and have potential carcinogenic and mutagenic effects on human health [20,26]\nMicro- and nano-plastics (MNPs) pollution has become a pressing global environmental issue, with growing concerns regarding its impact on human health. However, evidence on the effects of MNPs on human health remains limited. This paper reviews the three ...\nHowever, direct evidence for the effects of MNPs on human health is still scarce, and future research in this area is needed to provide quan","thumbnail_url":"https://imgs.you.com/SjK8crmwMZfjntZZIyw-TTlcRNgju1jCxJbwmyjJT_k/rs:fit:200:200:1:0/g:ce/aHR0cHM6Ly93d3cu/bmNiaS5ubG0ubmlo/Lmdvdi9jb3JlaHRt/bC9wbWMvcG1jZ2lm/cy9wbWMtY2FyZC1z/aGFyZS5qcGc_Xz0w","url":"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC10902512/#:~:text=However%2C%20available%20evidence%20from,is%20needed%20to%20provide"},{"source_type":"web_search","citation_uri":"https://pmc.ncbi.nlm.nih.gov/articles/PMC12197308/#:~:text=Since%202014%2C%20research%20on,limited%20ingestion%20of%20PS%E2%80%94since","provider":null,"title":"Risk Assessment of Microplastics in Humans: Distribution, Exposure, and Toxicological Effects - PMC","snippet":"Public health policies should prioritize minimizing detachable plastics in medical devices and food packaging, promote the application and validation of biodegradable polymers (e.g., PLA), and strengthen educational campaigns to curb everyday exposure. However, the ecological safety of biodegradable plastics must be comprehensively evaluated, since their degradation products can form microplastics with toxicity profiles comparable to those of conventional polymers. Moreover, health risk assessments of microplastics should evolve from single-polymer examinations to mixed-exposure scenarios, with attention directed to synergistic interactions involving per- and polyfluoroalkyl substances (PFOS, PFOA), endocrine-disrupting chemicals (EDCs), pharmaceuticals and personal care products (PPCPs), carcinogenic polycyclic aromatic hydrocarbons (PAHs), and brominated flame retardants.\nModule 4 (red cluster)—the group most closely connected to “microplastics/nanoplastics”—indicates that these “emerging pollutants/contaminants” threaten “human health (risk)” through “human exposure.” This exposure pathway involves “drinking water” and the “food chain,” resulting in “trophic transfer” and “bioaccumulation.” Overall, although human-related microplastic research spans topics such as sources, distribution, and morphology, its principal focus remains the assessment and elucidation of risks to human health and safety.\nPublic health policies should prioritize minimizing detachable plastics in medical devices and food packaging, promote the application and validation of biodegradable polymers (e.g., PLA), and strengthen educational campaigns to curb everyday exposure. However, the ecological safety of biodegradable plastics must be comprehensively evaluated, since their degradation products can form microplastics with toxicity profiles comparable to those of conventional poly","thumbnail_url":"","url":"https://pmc.ncbi.nlm.nih.gov/articles/PMC12197308/#:~:text=Since%202014%2C%20research%20on,limited%20ingestion%20of%20PS%E2%80%94since"},{"source_type":"web_search","citation_uri":"https://www.sciencedirect.com/science/article/pii/S004896972205210X#:~:text=This%20systematic%20review%20aims,lack%20of%20comparability%20between","provider":"null,","title":"A review of potential human health impacts of micro- and nanoplastics exposure - ScienceDirect","snippet":"This systematic review aims to summarize the current knowledge on biological effects of micro- and nanoplastics (MNPs) on human health based on mammal…\nPotential human health impact of MNPs is reviewed and summarized from 133 articles. ... Most studies (105 articles) used PS spheres for research due to the availability. ... Limitations that hinder reaching firm conclusions are highlighted. This systematic review aims to summarize the current knowledge on biological effects of micro- and nanoplastics (MNPs) on human health based on mammalian systems.\nIn contrast, the remaining 16 studies indicated an insignificant impact of MNPs on humans. A few studies attempted to investigate the mechanisms or factors driving the toxicity of MNPs and identified several determining factors including size, concentration, shape, surface charge, attached pollutants and weathering process, which, however, were not benchmarked or considered by most studies. This review demonstrates that there are still many inconsistencies in the evaluation of the potential health effects of MNPs due to the lack of comparability between studies.","thumbnail_url":"https://imgs.you.com/76W2dRcLAIlejPQmV5mh-z6WwZxbfp2HS7qcH7JtndE/rs:fit:200:200:1:0/g:ce/aHR0cHM6Ly9hcnMu/ZWxzLWNkbi5jb20v/Y29udGVudC9pbWFn/ZS8xLXMyLjAtUzAw/NDg5Njk3MjIwNTIx/MFgtZ2ExLmpwZw","url":"https://www.sciencedirect.com/science/article/pii/S004896972205210X#:~:text=This%20systematic%20review%20aims,lack%20of%20comparability%20between"},{"source_type":"web_search","citation_uri":"https://pmc.ncbi.nlm.nih.gov/articles/PMC11504192/#:~:text=Experiments%20show%20that%20the,identification%2C%20toxicity%2C%20and%20health","provider":"null,","title":"Potential Health Impact of Microplastics: A Review of Environmental Distribution, Human Exposure, and Toxic Effects - PMC","snippet":"Experiments show that the exposure to microplastics induces a variety of toxic effects, including oxidative stress, metabolic disorder, immune response, neurotoxicity, as well as reproductive and developmental toxicity.17 However, limited by the existing technical methods, there is no systematic ...\nExperiments show that the exposure to microplastics induces a variety of toxic effects, including oxidative stress, metabolic disorder, immune response, neurotoxicity, as well as reproductive and developmental toxicity.17 However, limited by the existing technical methods, there is no systematic research on the absorption, metabolism, migration, transformation, and accumulation of microplastics. The knowledge gap also exists in potential toxic effects and health hazards, e.g., the key factors determining the toxic effects of microplastics. This review briefly summarizes the pathways of human exposure to microplastics and the detection of microplastics in organisms and human bodies and focuses on the current research progress of the toxicity of microplastics.\nMicroplastics are ubiquitous in the global environment. As a typical emerging pollutant, its potential health hazards have been widely concerning. In this brief paper, we introduce the source, identification, toxicity, and health h","thumbnail_url":"","url":"https://pmc.ncbi.nlm.nih.gov/articles/PMC11504192/#:~:text=Experiments%20show%20that%20the,identification%2C%20toxicity%2C%20and%20health"}]}}

event: response.output_item.done
data: {"seq_id":2,"type":"response.output_item.done","response":{"output_index":0}}

event: response.output_text.delta
data: {"seq_id":7,"type":"response.output_text.delta","response":{"output_index":1,"type":"message.answer","delta":"A partial response to the question. You'll recieve many of these events to stream down the response as its being generated"}}

event: response.done
data: {"seq_id":365,"type":"response.done","response":{"run_time_ms":"5.956","finished":true}}
```

**SDK Code**

```python
# Use our official Python SDK to stream the agent response
from youdotcom import You
from youdotcom.models import (
    AdvancedAgentRunsRequest,
    ResponseCreated,
    ResponseStarting,
    ResponseOutputItemAdded,
    ResponseOutputContentFull,
    ResponseOutputTextDelta,
    ResponseOutputItemDone,
    ResponseDone,
)

with You("api_key") as you:
  response = you.agents.runs.create(
    request=AdvancedAgentRunsRequest(
      input="Explain the impacts of microplastics on the human body",
      stream=True
    )
  )

  with response as stream:
      for chunk in stream:
          event = chunk.data

          # Handle each streaming event type
          if isinstance(event, ResponseCreated):
              print(f"Response created (seq: {event.seq_id})")

          elif isinstance(event, ResponseStarting):
              print(f"Response starting (seq: {event.seq_id})")

          elif isinstance(event, ResponseOutputItemAdded):
              print(f"Output item added (seq: {event.seq_id})")

          elif isinstance(event, ResponseOutputContentFull):
              # Full content from tool results (e.g., search results)
              if event.response.full:
                  for result in event.response.full:
                      print(f"  Source: {result.title} - {result.url}")

          elif isinstance(event, ResponseOutputTextDelta):
              # Stream text as it arrives
              print(event.response.delta, end="", flush=True)

          elif isinstance(event, ResponseOutputItemDone):
              print(f"\nOutput complete (index: {event.response.output_index})")

          elif isinstance(event, ResponseDone):
              print(f"\nDone in {event.response.run_time_ms}ms")

```

```typescript
// Use our official TypeScript SDK to stream the agent response
import { You } from "@youdotcom-oss/sdk";
import type { AdvancedAgentRunsRequest, AgentRunsStreamingResponse } from "@youdotcom-oss/sdk/models";
import type { EventStream } from "@youdotcom-oss/sdk/lib/event-streams.js";

const you = new You({ apiKeyAuth: "api_key" });

const request: AdvancedAgentRunsRequest = {
  agent: "advanced",
  stream: true,
  input: "You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common sources and dosages of microplastics are. Highlight what a safe dosage might be and how to achieve it",
  tools: [{
    type: "research",
    searchEffort: "low",
    reportVerbosity: "medium",
  }]
};

const result = await you.agentsRuns(request) as EventStream<AgentRunsStreamingResponse>;

for await (const chunk of result) {
  if (chunk.data.type === "response.output_text.delta") {
    process.stdout.write(chunk.data.response.delta);
  }
}

```

```javascript
// Use our official JavaScript SDK to stream the agent response
import { You } from "@youdotcom-oss/sdk";

const you = new You({ apiKeyAuth: "api_key" });

const request = {
  agent: "advanced",
  stream: true,
  input: "You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common sources and dosages of microplastics are. Highlight what a safe dosage might be and how to achieve it",
  tools: [{
    type: "research",
    searchEffort: "low",
    reportVerbosity: "medium",
  }]
};

const result = await you.agentsRuns(request);

for await (const chunk of result) {
  if (chunk.data.type === "response.output_text.delta") {
    process.stdout.write(chunk.data.response.delta);
  }
}

```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.you.com/v1/agents/runs"

	payload := strings.NewReader("{\n  \"agent\": \"advanced\",\n  \"input\": \"You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common sources and dosages of microplastics are. Highlight what a safe dosage might be and how to achieve it\",\n  \"stream\": true\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.you.com/v1/agents/runs")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"agent\": \"advanced\",\n  \"input\": \"You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common sources and dosages of microplastics are. Highlight what a safe dosage might be and how to achieve it\",\n  \"stream\": true\n}")
  .asString();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.you.com/v1/agents/runs");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"agent\": \"advanced\",\n  \"input\": \"You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common sources and dosages of microplastics are. Highlight what a safe dosage might be and how to achieve it\",\n  \"stream\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "agent": "advanced",
  "input": "You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common sources and dosages of microplastics are. Highlight what a safe dosage might be and how to achieve it",
  "stream": true
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.you.com/v1/agents/runs")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```