Find answers from the community

Home
Members
progcap
p
progcap
Offline, last seen 4 months ago
Joined September 25, 2024
hey guys, cant find any documentation for SQLTableRetrieverQueryEngine. i want to change the model to "gpt-3.5-turbo-16k-0613" but cant seem to insert this as a paramater:

Here's code (copied from https://gpt-index.readthedocs.io/en/latest/examples/index_structs/struct_indices/duckdb_sql_query.html#advanced-text-to-sql-with-our-sqltableretrieverqueryengine):

query_engine = SQLTableRetrieverQueryEngine(
sql_database,
obj_index.as_retriever(similarity_top_k=1),
)


just for reference i was able to do the same with the engine using the following code:

llm_predictor = LLMPredictor(llm=ChatOpenAI(temperature=0, model_name="gpt-3.5-turbo-16k-0613", max_tokens=512, verbose = True))
service_context = ServiceContext.from_defaults(llm_predictor=llm_predictor)

query_engine = NLSQLTableQueryEngine(
sql_database=sql_database,
tables=tables_selected,
service_context=service_context,
)
9 comments
p
L
is there a detailed documentation for SQLDatabase?

I used the command:
sql_database = SQLDatabase(engine)

But when i display table info:
sql_database.table_info

I get the following error:
CompileError: (in table 'company_erp_instance_data_requests', column 'request_data'): Can't generate DDL for NullType(); did you forget to specify a type on this Column?

PS: this column stores xml.

any suggestions?
2 comments
p
L