Originally created by @heyfavour on GitHub (Jan 22, 2025).
how to get image in tools?
i try to get image_url but sometimes image_url will be wrong
import os
import requests
import base64
from datetime import datetime
from io import BytesIO
class Tools:
def __init__(self):
passs
def get_SMILES(self, image_url: str) -> str:
"""
Extract chemical SMILES from a Base64-encoded image.
:param image_url: Base64-encoded image.
:return: The SMILES string representing the chemical structure in the image.
"""
try:
image_url = image_url.split(",")[1]
print(image_url)#sometimes image_url is wrong here
except Exception as e:
return str(e)
Originally created by @heyfavour on GitHub (Jan 22, 2025).
how to get image in tools?
i try to get image_url but sometimes image_url will be wrong
```
import os
import requests
import base64
from datetime import datetime
from io import BytesIO
class Tools:
def __init__(self):
passs
def get_SMILES(self, image_url: str) -> str:
"""
Extract chemical SMILES from a Base64-encoded image.
:param image_url: Base64-encoded image.
:return: The SMILES string representing the chemical structure in the image.
"""
try:
image_url = image_url.split(",")[1]
print(image_url)#sometimes image_url is wrong here
except Exception as e:
return str(e)
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @heyfavour on GitHub (Jan 22, 2025).
how to get image in tools?
i try to get image_url but sometimes image_url will be wrong