You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have implemented a local version that allows you to view SparkSqlToolkitTest.
@TestvoidtestRunningQuery() {
varsparkSql = SparkSql.builder()
.spark(spark)
.schema(SCHEMA)
.build().init();
varllm = ChatOpenAI.builder()
.temperature(0)
.build().init();
vartoolkit = newSparkSqlToolkit(sparkSql, llm);
varagentExecutor = createSparkSqlAgent(llm, toolkit);
// SELECT SQRT(AVG(Age)) FROM titanicvaractual = agentExecutor.run("whats the square root of the average age?");
// sometimes it's 'The square root of the average age is approximately 5.45.'assertEquals("5.45", actual);
// SELECT Name FROM titanic WHERE Survived = 1 ORDER BY Age DESC LIMIT 1actual = agentExecutor.run("What's the name of the oldest survived passenger?");
assertEquals("Barkworth, Mr. Algernon Henry Wilson", actual);
}
https://python.langchain.com/docs/modules/agents/toolkits/spark_sql
The text was updated successfully, but these errors were encountered: