Skip to content

Conversation

asilvester-nw
Copy link

@asilvester-nw asilvester-nw commented Jul 28, 2025

This PR improves the flexibility of the Snowpark session configuration by allowing an optional session object to be injected. If a session is provided, it will be used directly instead of initializing a new one from environment variables. This change simplifies testing and integration scenarios where session reuse is preferred. Additionally, the environment validation logic has been updated to skip checks when a session is already supplied.

Fixes #150

Updated the ChatSnowflakeCortex class to accept an existing Snowpark session object as an optional parameter. If provided, the session is validated for correctness and activity. If no session is given, a new session is created using environment variables. This enhancement improves flexibility in session management.
…ocumentation

Removed the internal session creation tracking and streamlined the validation process for external Snowpark sessions. Updated the documentation to clarify the usage of environment variables and constructor parameters for session management, enhancing overall clarity and usability.
@mdrxy
Copy link
Contributor

mdrxy commented Aug 19, 2025

Looks like it needs to be run through linting

@asilvester-nw
Copy link
Author

Okay, I'll give that a look.

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.

Snowflake Cortex chat model is not supporting Key pairing or OAuth
2 participants