Rename Organization to Project

We'll probably need a concept of organizations at some point in the future, but in practice the way we're using these in the codebase right now is as a project, so this renames it to that to avoid confusion.
This commit is contained in:
Kyle Corbitt
2023-08-09 15:49:19 -07:00
parent ac99c8e0f7
commit 16aa6672fc
30 changed files with 292 additions and 248 deletions

View File

@@ -311,9 +311,9 @@ const MODEL_RESPONSE_TEMPLATES: {
await prisma.loggedCallModelResponse.deleteMany();
const org = await prisma.organization.findFirst({
const project = await prisma.project.findFirst({
where: {
personalOrgUserId: {
personalProjectUserId: {
not: null,
},
},
@@ -322,8 +322,8 @@ const org = await prisma.organization.findFirst({
},
});
if (!org) {
console.error("No org found. Sign up to create your first org.");
if (!project) {
console.error("No project found. Sign up to create your first project.");
process.exit(1);
}
@@ -348,7 +348,7 @@ for (let i = 0; i < 1437; i++) {
id: loggedCallId,
cacheHit: false,
startTime,
organizationId: org.id,
projectId: project.id,
createdAt: startTime,
});
@@ -373,7 +373,7 @@ for (let i = 0; i < 1437; i++) {
respStatus: template.respStatus,
error: template.error,
createdAt: startTime,
cacheKey: hashRequest(org.id, template.reqPayload as JsonValue),
cacheKey: hashRequest(project.id, template.reqPayload as JsonValue),
durationMs: endTime.getTime() - startTime.getTime(),
inputTokens: template.inputTokens,
outputTokens: template.outputTokens,