#Streamlit using a OpenAI for querying metadata for multiple Snowflake tables

1 messages · Page 1 of 1 (latest)

pulsar epoch
#

kristi.vice
14h

I’m using a quickstart guide that includes a prompt file that lets us add top level info about 2 Snowflake tables that I send to OpeanAi via a function I created: get_system_prompt
which is used like this:
st.session_state.messages = [{"role": "system", "content": get_system_prompt()}]

In this function I’ve hardcoded a table description variable that I wrote describing the 2 tables.

Unfortunately I can’t attach a link but the name of the quickstart I’m using is " Frosty: Build an LLM Chatbot in Streamlit on your Snowflake Data"

I’m looking for some recommendations on how to make this more dynamic so I don’t have to hardcode each table name, and also how to make the table description for each table? Is it necessary to include the table description, its alot of typing for like 100 tables… Open to any/all suggestions!

weary elbowBOT
#

Hi @pulsar epoch. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Hmm, I don't know enough to give you a confident answer yet. The extracts provided do not contain specific information about querying metadata for multiple Snowflake tables using OpenAI in a Streamlit application. However, I can provide some general guidance based on the information available.

From the extracts, it's clear that OpenAI models can be fine-tuned to better handle specific tasks or data structures. This could potentially be applied to your use case, where you want to dynamically handle descriptions for multiple Snowflake tables. Fine-tuning involves preparing and uploading training data, training a new fine-tuned model, evaluating results, and using your fine-tuned model (source (https://platform.openai.com/docs/guides/fine-tuning)).

In terms of making your prompts more dynamic, the extracts suggest that you can use a few-shot prompt to extend or modify a fine-tuning dataset. This could potentially be used to extract a structured dataset from your unstructured text, and then fine-tune a custom model on that structured dataset (source (https://github.com/openai/openai-cookbook/blob/main/articles/techniques_to_improve_reliability.md)).

For better results, it's recommended to use the latest models and to be specific, descriptive, and as detailed as possible about the desired context, outcome, length, format, style, etc. (source (https://help.openai.com/en/articles/6654000-best-practices-for-prompt-engineering-with-openai-api#h_ad50145be0)).