Skip to content

Conversation

@msabramo
Copy link
Contributor

Added a PROMPTY_CHAT_PARSER_DISABLE_IMAGE_PARSING=true environment variable to disable image parsing in the chat parser.

In my use case, I am using Prompty to send a prompt to the LLM that contains Markdown that should be converted to a different format. I do not need Prompty to parse the images and try to send them to the LLM. In fact, this is inconvenient because I don't want to have to copy the images just so Prompty can read them.

An environment variable seems kind of janky perhaps, but it's the best solution I could come up with that doesn't require a lot of changes, because there's a fairly deep call stack so in order to pass a parameter, it would require modifying a lot of code. I'm open to other ideas though.

Added a `PROMPTY_CHAT_PARSER_DISABLE_IMAGE_PARSING=true` environment variable to
disable image parsing in the chat parser.

In my use case, I am using Prompty to send a prompt to the LLM that contains Markdown that
should be converted to a different format. I do not need Prompty to parse the
images and try to send them to the LLM. In fact, this is inconvenient because I don't
want to have to copy the images just so Prompty can read them.

An environment variable seems kind of janky perhaps, but it's the best solution
I could come up with that doesn't require a lot of changes, because there's a
fairly deep call stack so in order to pass a parameter, it would require
modifying a lot of code. I'm open to other ideas though.
Copy link
Member

@sethjuarez sethjuarez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good idea - let me think about how to do this in a more declarative way.

@msabramo
Copy link
Contributor Author

msabramo commented Jun 7, 2025

Bump

@taylorn-ai
Copy link

Could this please be reviewed? This is actually causing a problem for me right now.

@sethjuarez @weastler @markwallace-microsoft

@taylorn-ai
Copy link

I have made some changes, but I haven't put in a PR yet though, as the newer version of Prompty is quite different, and seemingly inconsistent. For example, this is in the chat.prompty test file:

inputs:
  messages:
    type: array
    items: 
      type: object
      properties: 
        role: { type: string }
        content: { type: string }

And if I try to use this example, I get an exception as it doesn't expect items to be there...

Also when _validate_inputs is called, it's not checking the required value, it just checks if there is a default value, if not, throws a ValueError. So it's hard for me to test properly...

@taylorn-ai
Copy link

OK fixed a few things PR #274. @sethjuarez - could you please review?

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

Successfully merging this pull request may close these issues.

3 participants