mirror of
https://github.com/eliasstepanik/core.git
synced 2026-01-20 20:48:29 +00:00
fix: mcp tools
This commit is contained in:
parent
3eabd54032
commit
68322c16ae
@ -87,33 +87,32 @@ export function LogDetails({ log }: LogDetailsProps) {
|
|||||||
|
|
||||||
// Fetch episode facts when dialog opens and episodeUUID exists
|
// Fetch episode facts when dialog opens and episodeUUID exists
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (facts.length === 0) {
|
if (log.data?.type === "DOCUMENT" && log.data?.episodes?.length > 0) {
|
||||||
if (log.data?.type === "DOCUMENT" && log.data?.episodes?.length > 0) {
|
setFactsLoading(true);
|
||||||
setFactsLoading(true);
|
setFacts([]);
|
||||||
// Fetch facts for all episodes in DOCUMENT type
|
// Fetch facts for all episodes in DOCUMENT type
|
||||||
Promise.all(
|
Promise.all(
|
||||||
log.data.episodes.map((episodeId: string) =>
|
log.data.episodes.map((episodeId: string) =>
|
||||||
fetch(`/api/v1/episodes/${episodeId}/facts`).then((res) =>
|
fetch(`/api/v1/episodes/${episodeId}/facts`).then((res) =>
|
||||||
res.json(),
|
res.json(),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
.then((results) => {
|
)
|
||||||
const allFacts = results.flatMap((result) => result.facts || []);
|
.then((results) => {
|
||||||
const allInvalidFacts = results.flatMap(
|
const allFacts = results.flatMap((result) => result.facts || []);
|
||||||
(result) => result.invalidFacts || [],
|
const allInvalidFacts = results.flatMap(
|
||||||
);
|
(result) => result.invalidFacts || [],
|
||||||
setFacts(allFacts);
|
);
|
||||||
setInvalidFacts(allInvalidFacts);
|
setFacts(allFacts);
|
||||||
setFactsLoading(false);
|
setInvalidFacts(allInvalidFacts);
|
||||||
})
|
setFactsLoading(false);
|
||||||
.catch(() => {
|
})
|
||||||
setFactsLoading(false);
|
.catch(() => {
|
||||||
});
|
setFactsLoading(false);
|
||||||
} else if (log.episodeUUID) {
|
});
|
||||||
setFactsLoading(true);
|
} else if (log.episodeUUID) {
|
||||||
fetcher.load(`/api/v1/episodes/${log.episodeUUID}/facts`);
|
setFactsLoading(true);
|
||||||
}
|
fetcher.load(`/api/v1/episodes/${log.episodeUUID}/facts`);
|
||||||
}
|
}
|
||||||
}, [log.episodeUUID, log.data?.type, log.data?.episodes, facts.length]);
|
}, [log.episodeUUID, log.data?.type, log.data?.episodes, facts.length]);
|
||||||
|
|
||||||
@ -218,7 +217,7 @@ export function LogDetails({ log }: LogDetailsProps) {
|
|||||||
<span>Content</span>
|
<span>Content</span>
|
||||||
</div>
|
</div>
|
||||||
{/* Log Content */}
|
{/* Log Content */}
|
||||||
<div className="mb-4 text-sm break-words whitespace-pre-wrap">
|
<div className="mb-4 w-full text-sm break-words whitespace-pre-wrap">
|
||||||
<div className="rounded-md">
|
<div className="rounded-md">
|
||||||
<Markdown>{log.ingestText}</Markdown>
|
<Markdown>{log.ingestText}</Markdown>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -75,7 +75,6 @@ export const memoryTools = [
|
|||||||
all: {
|
all: {
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
description: "Get all spaces",
|
description: "Get all spaces",
|
||||||
default: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -90,7 +89,6 @@ export const memoryTools = [
|
|||||||
profile: {
|
profile: {
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
description: "Get user profile",
|
description: "Get user profile",
|
||||||
default: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user