Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image not showing up in chatGPT #1

Open
knoel99 opened this issue Jul 17, 2023 · 0 comments
Open

Image not showing up in chatGPT #1

knoel99 opened this issue Jul 17, 2023 · 0 comments

Comments

@knoel99
Copy link

knoel99 commented Jul 17, 2023

Hello,
I am trying to reproduce the Astrodaily plugin from the plugin retreival from OpenAi, but no image is showed in chatGPT.

I mounted the folders where the images are stored, the image is found but nothing is showed

What do you think is missing?

image
image

app = FastAPI(dependencies=[Depends(validate_token)])
app.mount("/.well-known/", StaticFiles(directory=".well-known"), name="static")

# Mount "img" subdirectory at path "/img"
app.mount("/img/", StaticFiles(directory="img"), name="img")

[...]

@app.get("/nasa", response_model=NasaResponse)
async def nasa(dependencies=[Depends(validate_token)]):
    try:
        # Log the list of files
        logger.info(f"Nasa before Current working directory: {os.getcwd()}")
        files = os.listdir('.')
        logger.info(f"Files in current directory: {files}")

        imageURL="./img/nasa_hubble.jpg"

        try:
            # Get the file size
            file_size = os.stat(imageURL).st_size

            # Log the file size
            logger.info(f'The size of the image file is {file_size} bytes')

        except FileNotFoundError:
            logger.error(f'The file {imageURL} was not found.')
        except PermissionError:
            logger.error(f'Permission denied for accessing the file {imageURL}.')

        return NasaResponse(imageURL=imageURL)

    except Exception as e:
        logger.error(e)
        raise HTTPException(status_code=500, detail="Internal Service Error")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant