Spaces:
Runtime error
Runtime error
Download scripts/services/services.py from ayushsinghal1510/kapil-vps: direct link, hf CLI and curl.
- Browser
- Download file 561 Bytes
-
https://huggingface.co/spaces/ayushsinghal1510/kapil-vps/resolve/main/scripts/services/services.py
- Command line
-
hf download hf://spaces/ayushsinghal1510/kapil-vps/scripts/services/services.py
-
curl -L -o services.py https://huggingface.co/spaces/ayushsinghal1510/kapil-vps/resolve/main/scripts/services/services.py
561 Bytes
| from google.genai import types | |
| async def json_to_google_chat(chat) : | |
| contents = [] | |
| for row in chat : | |
| role = row['role'] | |
| if role == 'user' : contents.append( | |
| types.Content( | |
| role = 'user' , | |
| parts = [types.Part.from_text(text = str(row['content']))] | |
| ) | |
| ) | |
| else : contents.append( | |
| types.Content( | |
| role = 'model' , | |
| parts = [types.Part.from_text(text = str(row['content']))] | |
| ) | |
| ) | |
| return contents |