<commit_before># stdlib
import json
from typing import Any

# third party
from fastapi import APIRouter
from fastapi import Depends
from fastapi import Request
from fastapi import Response

# syft absolute
from syft import deserialize
from syft import serialize
from syft.core.common.message import SignedImmediateSyftMessageWithReply
from syft.core.common.message import SignedImmediateSyftMessageWithoutReply
from syft.core.common.message import SignedMessage
from syft.core.node.enums import RequestAPIFields
from syft.util import get_tracer

# grid absolute
from grid.api.dependencies.current_user import get_current_user
from grid.api.users.models import UserPrivate
from grid.core.celery_app import celery_app
from grid.core.config import settings
from grid.core.node import node

router = APIRouter()

tracer = get_tracer("API")


async def get_body(request: Request) -> bytes:
    return await request.body()


@router.get("/metadata", response_model=str)
def syft_metadata() -> Response:
    return Response(
        node.get_metadata_for_client()._object2proto().SerializeToString(),
        media_type="application/octet-stream",
    )


@router.delete("", response_model=str)<commit_msg>ADD /syft/version endpoint<commit_after># stdlib
import json
from typing import Any

# third party
from fastapi import APIRouter
from fastapi import Depends
from fastapi import Request
from fastapi import Response
from fastapi.responses import JSONResponse

# syft absolute
from syft import __version__
from syft import deserialize
from syft import serialize
from syft.core.common.message import SignedImmediateSyftMessageWithReply
from syft.core.common.message import SignedImmediateSyftMessageWithoutReply
from syft.core.common.message import SignedMessage
from syft.core.node.enums import RequestAPIFields
from syft.util import get_tracer

# grid absolute
from grid.api.dependencies.current_user import get_current_user
from grid.api.users.models import UserPrivate
from grid.core.celery_app import celery_app
from grid.core.config import settings
from grid.core.node import node

router = APIRouter()

tracer = get_tracer("API")


async def get_body(request: Request) -> bytes:
    return await request.body()


@router.get("/version")
def syft_version() -> Response:
    return JSONResponse(content={"version": __version__})


@router.get("/metadata", response_model=str)
def syft_metadata() -> Response:
    return Response(
        node.get_metadata_for_client()._object2proto().SerializeToString(),
        media_type="application/octet-stream",
    )


@router.delete("", response_model=str)
{'fraction_non_alphanumeric': 0.07733743747595229, 'fraction_numerical': 0.0007695267410542517, 'mean_word_length': 5.54911838790932, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4218890', 'n_tokens_mistral': 746, 'n_tokens_neox': 743, 'n_words': 218}