mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-08 22:05:08 -05:00
Fix agent check
This commit is contained in:
@@ -124,11 +124,11 @@ async def get_library_agent(
|
||||
agent = store_listing_version.Agent
|
||||
|
||||
# Check if user already has this agent
|
||||
existing_user_agent = await prisma.models.UserAgent.prisma().find_first(
|
||||
existing_user_agent = await prisma.models.AgentGraph.prisma().find_first(
|
||||
where={
|
||||
"userId": user_id,
|
||||
"agentId": agent.id,
|
||||
"agentVersion": agent.version,
|
||||
"id": agent.id,
|
||||
"version": agent.version,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -45,14 +45,18 @@ export const AgentInfo: React.FC<AgentInfoProps> = ({
|
||||
const [processing, setProcessing] = React.useState(false);
|
||||
|
||||
React.useEffect(() => {
|
||||
(async () => {
|
||||
console.log("Fetching library agent...");
|
||||
const fetchAgent = async () => {
|
||||
try {
|
||||
console.log("Trying...");
|
||||
const agent = await api.getUserLibraryAgent(storeListingVersionId);
|
||||
setAgent(agent);
|
||||
console.log("Fetched agent:", agent);
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch library agent:", error);
|
||||
}
|
||||
})();
|
||||
};
|
||||
fetchAgent();
|
||||
}, [api, storeListingVersionId]);
|
||||
|
||||
const handleAddToLibrary = React.useCallback(async () => {
|
||||
|
||||
Reference in New Issue
Block a user