# flytekit.interaction.string_literals

## Directory

### Methods

| Method | Description |
|-|-|
| [`literal_map_string_repr()`](#literal_map_string_repr) | This method is used to convert a literal map to a string representation. |
| [`literal_string_repr()`](#literal_string_repr) | This method is used to convert a literal to a string representation. |
| [`primitive_to_string()`](#primitive_to_string) | This method is used to convert a primitive to a string representation. |
| [`scalar_to_string()`](#scalar_to_string) | This method is used to convert a scalar to a string representation. |

## Methods

#### literal_map_string_repr()

```python
def literal_map_string_repr(
    lm: typing.Union[flytekit.models.literals.LiteralMap, typing.Dict[str, flytekit.models.literals.Literal]],
) -> typing.Dict[str, typing.Any]
```
This method is used to convert a literal map to a string representation.

| Parameter | Type | Description |
|-|-|-|
| `lm` | `typing.Union[flytekit.models.literals.LiteralMap, typing.Dict[str, flytekit.models.literals.Literal]]` | |

#### literal_string_repr()

```python
def literal_string_repr(
    lit: flytekit.models.literals.Literal,
) -> typing.Any
```
This method is used to convert a literal to a string representation. This is useful in places, where we need to
use a shortened string representation of a literal, especially a FlyteFile, FlyteDirectory, or StructuredDataset.

| Parameter | Type | Description |
|-|-|-|
| `lit` | `flytekit.models.literals.Literal` | |

#### primitive_to_string()

```python
def primitive_to_string(
    primitive: flytekit.models.literals.Primitive,
) -> typing.Any
```
This method is used to convert a primitive to a string representation.

| Parameter | Type | Description |
|-|-|-|
| `primitive` | `flytekit.models.literals.Primitive` | |

#### scalar_to_string()

```python
def scalar_to_string(
    scalar: flytekit.models.literals.Scalar,
) -> typing.Any
```
This method is used to convert a scalar to a string representation.

| Parameter | Type | Description |
|-|-|-|
| `scalar` | `flytekit.models.literals.Scalar` | |

---
**Source**: https://github.com/unionai/unionai-docs/blob/main/content/api-reference/flytekit-sdk/packages/flytekit.interaction.string_literals.md
**HTML**: https://www.union.ai/docs/v1/union/api-reference/flytekit-sdk/packages/flytekit.interaction.string_literals/
