decrease certainty threshhold on block search

This commit is contained in:
amirhouieh 2023-05-18 15:51:57 +02:00
parent f78bfa635c
commit 674d1877a4
2 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import { ImageResponse } from '@vercel/og' import { ImageResponse } from '@vercel/og'
import { handleMethodNotAllowedResponse } from 'next/dist/server/future/route-modules/helpers/response-handlers'
export const config = { export const config = {
runtime: 'edge', runtime: 'edge',
@ -36,3 +37,4 @@ export default async function handler() {
}, },
) )
} }
handleMethodNotAllowedResponse()

View File

@ -399,7 +399,7 @@ class UnbodyService extends UnbodyClient {
? { ? {
nearText: { nearText: {
concepts: [q, ...tags].filter((t) => t.trim().length > 0), concepts: [q, ...tags].filter((t) => t.trim().length > 0),
certainty: 0.85, certainty: 0.75,
}, },
} }
: {} : {}
@ -420,6 +420,8 @@ class UnbodyService extends UnbodyClient {
limit: 20, limit: 20,
}) })
console.log(query)
return this.request<UnbodyGraphQlResponseBlocks>(query) return this.request<UnbodyGraphQlResponseBlocks>(query)
.then(({ data }) => { .then(({ data }) => {
if (!data || !(data.Get.ImageBlock || data.Get.TextBlock)) if (!data || !(data.Get.ImageBlock || data.Get.TextBlock))