-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Harrison/sql query #8370
Harrison/sql query #8370
Conversation
…passed to all invoke/stream/batch calls when it is run
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
), | ||
} | prompt_to_use | ||
return ( | ||
formatted_prompt | llm.bind(stop=["\nSQLResult:"]) | NoOpOutputParser() | _strip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think you can just str.strip instead of _strip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooc: do lambdas work here too?
"table_info": lambda x: db.get_table_info( | ||
table_names=x.get("table_names_to_use") | ||
), | ||
} | prompt_to_use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh this actually seems more confusing to me right now
prompt: Optional[BasePromptTemplate] = None, | ||
k: int = 5, | ||
) -> RunnableSequence: | ||
if prompt is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if part of goal is to show how succinctly we can create this chain:
prompt = prompt or SQL_PROMPTS.get(db.dialect, PROMPT)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some weird typing thing prevented this
prompt_to_use = SQL_PROMPTS[db.dialect] | ||
else: | ||
prompt_to_use = PROMPT | ||
formatted_prompt = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
input_to_prompt_vars = {...}
return input_to_prompt_vars | prompt_to_use | llm...
more readable imo
No description provided.