mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-01-21 04:57:58 -05:00
Compare commits
2 Commits
testing-cl
...
worktree/d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b20dd0f50 | ||
|
|
dc0cacb2e6 |
@@ -105,6 +105,7 @@ def library_agent_include(
|
|||||||
"""
|
"""
|
||||||
result: prisma.types.LibraryAgentInclude = {
|
result: prisma.types.LibraryAgentInclude = {
|
||||||
"Creator": True, # Always needed for creator info
|
"Creator": True, # Always needed for creator info
|
||||||
|
"StoreListingVersion": True, # Always needed for marketplace metadata
|
||||||
}
|
}
|
||||||
|
|
||||||
# Build AgentGraph include based on requested options
|
# Build AgentGraph include based on requested options
|
||||||
|
|||||||
@@ -714,6 +714,7 @@ async def add_store_agent_to_library(
|
|||||||
"graphVersionId": {"id": graph.id, "version": graph.version}
|
"graphVersionId": {"id": graph.id, "version": graph.version}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"StoreListingVersion": {"connect": {"id": store_listing_version_id}},
|
||||||
"isCreatedByUser": False,
|
"isCreatedByUser": False,
|
||||||
},
|
},
|
||||||
include=library_agent_include(
|
include=library_agent_include(
|
||||||
|
|||||||
@@ -116,6 +116,17 @@ class LibraryAgent(pydantic.BaseModel):
|
|||||||
# Hard-coded to True until a method to check is implemented
|
# Hard-coded to True until a method to check is implemented
|
||||||
is_latest_version = True
|
is_latest_version = True
|
||||||
|
|
||||||
|
# Use marketplace name and description if available (for downloaded agents)
|
||||||
|
name = graph.name
|
||||||
|
description = graph.description
|
||||||
|
instructions = graph.instructions
|
||||||
|
if agent.StoreListingVersion:
|
||||||
|
name = agent.StoreListingVersion.name
|
||||||
|
description = agent.StoreListingVersion.description
|
||||||
|
# Use marketplace instructions if available, otherwise fall back to graph instructions
|
||||||
|
if agent.StoreListingVersion.instructions:
|
||||||
|
instructions = agent.StoreListingVersion.instructions
|
||||||
|
|
||||||
return LibraryAgent(
|
return LibraryAgent(
|
||||||
id=agent.id,
|
id=agent.id,
|
||||||
graph_id=agent.agentGraphId,
|
graph_id=agent.agentGraphId,
|
||||||
@@ -125,9 +136,9 @@ class LibraryAgent(pydantic.BaseModel):
|
|||||||
creator_image_url=creator_image_url,
|
creator_image_url=creator_image_url,
|
||||||
status=status,
|
status=status,
|
||||||
updated_at=updated_at,
|
updated_at=updated_at,
|
||||||
name=graph.name,
|
name=name,
|
||||||
description=graph.description,
|
description=description,
|
||||||
instructions=graph.instructions,
|
instructions=instructions,
|
||||||
input_schema=graph.input_schema,
|
input_schema=graph.input_schema,
|
||||||
output_schema=graph.output_schema,
|
output_schema=graph.output_schema,
|
||||||
credentials_input_schema=(
|
credentials_input_schema=(
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "LibraryAgent" ADD COLUMN "storeListingVersionId" TEXT;
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE INDEX "LibraryAgent_storeListingVersionId_idx" ON "LibraryAgent"("storeListingVersionId");
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "LibraryAgent" ADD CONSTRAINT "LibraryAgent_storeListingVersionId_fkey" FOREIGN KEY ("storeListingVersionId") REFERENCES "StoreListingVersion"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||||
@@ -258,6 +258,9 @@ model LibraryAgent {
|
|||||||
creatorId String?
|
creatorId String?
|
||||||
Creator Profile? @relation(fields: [creatorId], references: [id])
|
Creator Profile? @relation(fields: [creatorId], references: [id])
|
||||||
|
|
||||||
|
storeListingVersionId String?
|
||||||
|
StoreListingVersion StoreListingVersion? @relation(fields: [storeListingVersionId], references: [id])
|
||||||
|
|
||||||
useGraphIsActiveVersion Boolean @default(false)
|
useGraphIsActiveVersion Boolean @default(false)
|
||||||
|
|
||||||
isFavorite Boolean @default(false)
|
isFavorite Boolean @default(false)
|
||||||
@@ -268,6 +271,7 @@ model LibraryAgent {
|
|||||||
@@unique([userId, agentGraphId, agentGraphVersion])
|
@@unique([userId, agentGraphId, agentGraphVersion])
|
||||||
@@index([agentGraphId, agentGraphVersion])
|
@@index([agentGraphId, agentGraphVersion])
|
||||||
@@index([creatorId])
|
@@index([creatorId])
|
||||||
|
@@index([storeListingVersionId])
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
@@ -834,6 +838,9 @@ model StoreListingVersion {
|
|||||||
// Reviews for this specific version
|
// Reviews for this specific version
|
||||||
Reviews StoreListingReview[]
|
Reviews StoreListingReview[]
|
||||||
|
|
||||||
|
// LibraryAgents that reference this version
|
||||||
|
LibraryAgents LibraryAgent[]
|
||||||
|
|
||||||
@@unique([storeListingId, version])
|
@@unique([storeListingId, version])
|
||||||
@@index([storeListingId, submissionStatus, isAvailable])
|
@@index([storeListingId, submissionStatus, isAvailable])
|
||||||
@@index([submissionStatus])
|
@@index([submissionStatus])
|
||||||
|
|||||||
Reference in New Issue
Block a user