Skip to content

CompetitorCheck drops whitespace between sentences #23

Description

@CalebCourier

NOTE: This is with remote inference. I haven't tried with the local model.

from guardrails.hub import CompetitorCheck

v = CompetitorCheck(
    competitors=["Fortran", "Ada", "Pascal"],
    on_fail="fix"
)

response = v.validate("The author is Paul Graham. Growing up, he worked on writing short stories and programming, starting with the IBM 1401 in 9th grade using an early version of Fortran. Later, he transitioned to microcomputers like the TRS-80 and began programming more extensively, creating simple games and a word processor.", {})

print(response.fix_value)
The author is Paul Graham.Growing up, he worked on writing short stories and programming, starting with the IBM 1401 in 9th grade using an early version of [COMPETITOR].Later, he transitioned to microcomputers like the TRS-80 and began programming more extensively, creating simple games and a word processor.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions