> ## Documentation Index
> Fetch the complete documentation index at: https://docs.graphext.com/llms.txt
> Use this file to discover all available pages before exploring further.

# fetch_google_vision

> Analyze images given their URL using the Google Vision API. 

Labels and categorizes images to indicate whether they contain violent, parodic, adult, medical or racy elements.

???+ info "API integration"
To use this step your team needs to have the *Google Vision* integration configured in Graphext. The corresponding credentials
are required to connect to a third-party API. You can configure API integrations following the `INTEGRATIONS` or `ADD INTEGRATION`
link in the top-left corner of your Team's page, selecting `API keys`, and then the name of the desired third-party service.

To enable the *Google Vision* integration in particular you will need access to Google's Vision service. Follow the instructions
[shere](https://cloud.google.com/vision/docs/setup) to create the required API key.

## Usage

The following example shows how the step can be used in a recipe.

<Accordion title="Examples" icon="code" defaultOpen="true">
  <Tabs>
    <Tab title="Example 1">
      The step has no configuration parameters, so it's simply

      ```stan theme={null}
      fetch_google_vision(ds.image_url) -> (
        ds.image_labels,
        ds.image_contains_violence,
        ds.image_is_spoof,
        ds.image_has_adult_content,
        ds.image_has_medical_content,
        ds.image_is_racy
      )
      ```
    </Tab>

    <Tab title="Signature">
      General syntax for using the step in a recipe. Shows the inputs and outputs the step is expected to receive and will produce respectively. For futher details see sections below.

      ```stan theme={null}
      fetch_google_vision(target_col: url, {
          "param": value,
          ...
      }) -> (
      	labels: list[category],
      	violence: category,
      	spoof: category,
      	adult: category,
      	medical: category,
      	racy: category
      )
      ```
    </Tab>
  </Tabs>
</Accordion>

## Inputs & Outputs

The following are the inputs expected by the step and the outputs it produces. These are generally
columns (`ds.first_name`), datasets (`ds` or `ds[["first_name", "last_name"]]`) or models (referenced
by name e.g. `"churn-clf"`).

<Accordion title="Inputs" icon="right-to-bracket">
  <ParamField path="target_col" type="column[url]" required>
    Direct URLs to the images to analyze, e.g. [https://upload.wikimedia.org/wikipedia/commons/c/c7/Madrid\_-\_El\_Oso\_y\_el\_Madro%C3%B1o.jpg](https://upload.wikimedia.org/wikipedia/commons/c/c7/Madrid_-_El_Oso_y_el_Madro%C3%B1o.jpg).
  </ParamField>
</Accordion>

<Accordion title="Outputs" icon="right-from-bracket">
  <ParamField path="labels" type="column[list[category]]" required>
    Lists of entities identified in the picture.
  </ParamField>

  <ParamField path="violence" type="column[category]" required>
    Indicates whether the image contains violence.
  </ParamField>

  <ParamField path="spoof" type="column[category]" required>
    Indicates whether the image is a spoof (parody).
  </ParamField>

  <ParamField path="adult" type="column[category]" required>
    Indicates whether the image features adult content.
  </ParamField>

  <ParamField path="medical" type="column[category]" required>
    Indicates whether the image features medical content.
  </ParamField>

  <ParamField path="racy" type="column[category]" required>
    Indicates whether the image features racy content.
  </ParamField>
</Accordion>

## Configuration

The following parameters can be used to configure the behaviour of the step by including them in
a json object as the last "input" to the step, i.e. `step(..., {"param": "value", ...}) -> (output)`.

<Accordion title="Parameters" defaultOpen="true" icon="sliders">
  <ParamField path="integration" type="string" required>
    ID of the integration you'd like to use.
  </ParamField>
</Accordion>
