Skip to content

Commit

Permalink
Merge pull request #20 from nextgen-ui-dev/issue-generator
Browse files Browse the repository at this point in the history
feat: identified embeddings not saved bug and updated gpt prompt
  • Loading branch information
jeremyalv authored Nov 7, 2023
2 parents cb215ef + b177bb5 commit 9229d8f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/modules/workspace/issue-generator/GeneratedIssuesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const GeneratedIssuesPage: React.FC<GeneratedIssuesPageProps> = ({
let generatedIssues: IssueData[] = [];
if (GeneratedIssuesData) {
generatedIssues = jsonToObjArray(GeneratedIssuesData);
console.log("generatedIssues", generatedIssues);
// console.log("generatedIssues", generatedIssues);
}

return (
Expand Down Expand Up @@ -79,7 +79,7 @@ const GeneratedIssuesPage: React.FC<GeneratedIssuesPageProps> = ({
</div>
) : (
<div className="flex flex-row items-center text-xl">
There seems to be a problem while displaying your issues
{"There seems to be a problem while displaying your issues. Have you tried chatting with the document first at `Documents` tab?"}
</div>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export const condenseQuestionTemplate = `
Issues are the smallest unit of task that a project team member could pick up. Issues should contain exactly 3 fields: Title, Description, and Priority (high/medium/low). Title should be the feature name that you recommend, for example: "Open new payment channels for e-commerce". Description should be an elaboration of the Title so engineers could understand, for example: "Integrate Stripe payment API into site". Priority should be guessed by the importance of the topic in the Title to the business. Don't just parrot from the document given, but try to create something new!
The output format for each issue shall be a single JSON with a numeric key (id) and a JSON value. The JSON value of each key contains 3 fields mentioned above. All JSON fields (but not the values), if a string type, should be in lowercase. No deviations from this format is allowed.
Regarding the description field, you should insert at least three things: the description of the issue, an example of user stories using the format (e.g. As a "product manager", I want to "automatically generate tickets", so that "I can reduce effort in managing tickets, like this but just remove the double quotes as it's only meant to show emphasis)
CONTEXT IS BELOW:
{context}
Expand Down
11 changes: 7 additions & 4 deletions src/server/api/routers/workspace/issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,17 @@ export const issueRouter = createTRPCRouter({
[document.id],
{ prepare: true },
);



const maxTimestamp = maxTimestampResult.rows[0]?.get(
"most_recent_created_at",
) as Date;
) as Date;

console.log(document.id);
console.log("maxTimestampResult", maxTimestampResult);
console.log("maxTimestamp", maxTimestamp);

// 1. Document Context Retrieval
// Create message to initiate embedding retrieval
// QA_1: Background
const backgroundEmbedding = new Float32Array(
await embeddingModel.embedQuery(Questions.backgroundQuestion),
);
Expand Down

0 comments on commit 9229d8f

Please sign in to comment.