MCPcopy Create free account
hub / github.com/FastLED/FastLED / _build_jsonrpc_payload

Function _build_jsonrpc_payload

ci/autoresearch/decode.py:91–107  ·  view source on GitHub ↗

Build a JSON-RPC request string with base64-encoded file data. Args: file_bytes: Raw file contents. extension: File extension including the dot (e.g. ".mp4"). Returns: JSON string of the JSON-RPC request.

(file_bytes: bytes, extension: str)

Source from the content-addressed store, hash-verified

89
90
91def _build_jsonrpc_payload(file_bytes: bytes, extension: str) -> str:
92 """Build a JSON-RPC request string with base64-encoded file data.
93
94 Args:
95 file_bytes: Raw file contents.
96 extension: File extension including the dot (e.g. ".mp4").
97
98 Returns:
99 JSON string of the JSON-RPC request.
100 """
101 b64_data = base64.b64encode(file_bytes).decode("ascii")
102 payload = {
103 "method": "decodeFile",
104 "params": [b64_data, extension],
105 "id": 1,
106 }
107 return json.dumps(payload)
108
109
110@dataclass(slots=True)

Callers 1

run_decode_autoresearchFunction · 0.85

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected