Skip to content

Add env var to disable image parsing#146

Closed
msabramo wants to merge 1 commit intomicrosoft:mainfrom
msabramo:add-env-var-to-disable-image-parsing
Closed

Add env var to disable image parsing#146
msabramo wants to merge 1 commit intomicrosoft:mainfrom
msabramo:add-env-var-to-disable-image-parsing

Conversation

@msabramo
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

msabramo commented Jun 7, 2025

Bump

@taylorn-ai
Copy link
Copy Markdown

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

@sethjuarez @weastler @markwallace-microsoft

@taylorn-ai
Copy link
Copy Markdown

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
Copy Markdown

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

@sethjuarez
Copy link
Copy Markdown
Member

Thank you for your contribution! We've migrated Prompty to v2 on main — the codebase has been significantly restructured with AgentSchema-based types, scoped @prompty/* npm packages, and new runtimes.

The v1 code is now preserved on the v1 branch for maintenance. If your change is still relevant for v1, please re-open against the v1 branch. For v2 contributions, please open a new PR against main.

Apologies for any inconvenience, and thanks for your patience!

@sethjuarez sethjuarez closed this Mar 25, 2026
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