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

Class existence inference in BAML source type hints #1267

Open
anerli opened this issue Dec 21, 2024 · 0 comments
Open

Class existence inference in BAML source type hints #1267

anerli opened this issue Dec 21, 2024 · 0 comments

Comments

@anerli
Copy link

anerli commented Dec 21, 2024

With a class as an optional param to a BAML source function, if we check that the variable is populated, we still get a warning saying it could be none.

Example:

function Foo (bar: Baz?) -> string {
	client MyClient
	prompt #"
		{ %if bar }
			{{ bar.x }} // Gives 'bar' is a (none | class Baz), expected class
		{ %endif% }
	"#
}
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