Skip to content

Commit

Permalink
✨ Fix prompting
Browse files Browse the repository at this point in the history
  • Loading branch information
asim-shrestha committed Nov 1, 2023
1 parent bf02304 commit b0523b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
3 changes: 0 additions & 3 deletions next/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@ const Home: NextPage = () => {

const agent = useAgentStore.use.agent();

const fullscreen = agent !== null;
const { session } = useAuth();
const nameInput = useAgentInputStore.use.nameInput();
const setNameInput = useAgentInputStore.use.setNameInput();
const goalInput = useAgentInputStore.use.goalInput();
const setGoalInput = useAgentInputStore.use.setGoalInput();
const [chatInput, setChatInput] = React.useState("");
const { settings } = useSettings();

const [showSignInDialog, setShowSignInDialog] = React.useState(false);
Expand All @@ -65,7 +63,6 @@ const Home: NextPage = () => {

const disableStartAgent =
(agent !== null && !["paused", "stopped"].includes(agentLifecycle)) ||
isEmptyOrBlank(nameInput) ||
isEmptyOrBlank(goalInput);

const handlePlay = (goal: string) => {
Expand Down
15 changes: 9 additions & 6 deletions platform/reworkd_platform/web/api/agent/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,19 @@
summarize_with_sources_prompt = PromptTemplate(
template="""You must answer in the "{language}" language.
Parse and summarize the following text snippets "{snippets}".
Parse and summarize the following: "{snippets}" to answer the following query: "{query}" as best as possible.
Write using clear markdown formatting in a style expected of the goal "{goal}".
Be as clear, informative, and descriptive as necessary and attempt to
answer the query: "{query}" as best as possible.
Cite sources for as many sentences as possible by using the corresponding source link. Use the index as the citation text.
Cite sources for sentences where possible by using the corresponding source link. Use the index as the citation text.
Incorporate the source using a markdown link directly at the end of the sentence that the source is used in.
Do not separately list sources at the end of the writing.
Example: "So this is a cited sentence at the end of a paragraph[1](https://test.com). This is another sentence."
If the query cannot be answered with the provided information, mention this and provide a reason why along with what it does mention.
Also cite the sources of what is actually mentioned.
Examples:
"So this is a cited sentence at the end of a paragraph[1](https://test.com). This is another sentence."
"Stephen curry is an american basketball player that plays for the warriors[1](https://www.britannica.com/biography/Stephen-Curry)."
""",
input_variables=["goal", "language", "query", "snippets"],
)
Expand Down

0 comments on commit b0523b9

Please sign in to comment.