analytics for gitbook lens #853
Replies: 5 comments 2 replies
-
What API are you using for Ask AI? If you use the API operation related to a site, I think it'll automatically be included in the analytics. But I'll let @emmerich confirm. |
Beta Was this translation helpful? Give feedback.
-
Hey @shlomof-pyle - currently no plans to introduce analytics for private content (i.e. content that isn't published via a site). However, GitBook sites can also be semi-private with share links / visitor auth. If it's feasible for you, you could publish your site privately and then use our |
Beta Was this translation helpful? Give feedback.
-
It is published via a site. What endpoint can i use for that? Currently i am working with https://api.gitbook.com/v1/orgs/{organizationId}/ask and creating an authenticated user for with specific access. But i actually want to use the site specific endpoint as you are saying.
Any documentation? I cant seem to find streamAskInSite
…________________________________
From: Steven H ***@***.***>
Sent: Monday, January 20, 2025 10:44 AM
To: GitbookIO/community ***@***.***>
Cc: Shlomo Friedman ***@***.***>; Mention ***@***.***>
Subject: Re: [GitbookIO/community] analytics for gitbook lens (Discussion #853)
Hey @shlomof-pyle<https://github.com/shlomof-pyle> - currently no plans to introduce analytics for private content (i.e. content that isn't published via a site).
However, GitBook sites can also be semi-private with share links / visitor auth. If it's feasible for you, you could publish your site privately and then use our streamAskInSite endpoint to do your Asks. They'll use your site for context + you'll get analytics at the site level. Hope this helps!
—
Reply to this email directly, view it on GitHub<#853 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BKPNMUWC5GWWDUHF2VJLLBL2LUKULAVCNFSM6AAAAABVQTRS5OVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCOBZGIYTEMI>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Im really struggling with this whole streaming response. Is there a reason its not a application/json and instead its a streaming response?
…________________________________
From: Steven H ***@***.***>
Sent: Monday, January 20, 2025 11:49 AM
To: GitbookIO/community ***@***.***>
Cc: Shlomo Friedman ***@***.***>; Mention ***@***.***>
Subject: Re: [GitbookIO/community] analytics for gitbook lens (Discussion #853)
If you're in a site then you should be good to go. Here's the endpoint you can use: https://docs.gitbook.com/developers/gitbook-api/reference/docs-sites/ask-ai
—
Reply to this email directly, view it on GitHub<#853 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BKPNMURN7BAAENOMLYNTYEL2LUSIXAVCNFSM6AAAAABVQTRS5OVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCOBZGI4TKMA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the tip, let me see if i can get this working
…________________________________
From: Steven H ***@***.***>
Sent: Monday, January 20, 2025 5:27 PM
To: GitbookIO/community ***@***.***>
Cc: Shlomo Friedman ***@***.***>; Mention ***@***.***>
Subject: Re: [GitbookIO/community] analytics for gitbook lens (Discussion #853)
We try to keep as many of our generative endpoints streams as it matches the experience most users are accustomed to. Which language are you writing in? We have a couple of working examples in the GitBook Open repository that I could point you to, all in Node using fetch.
This is a more complicated example<https://github.com/GitbookIO/gitbook/tree/main/packages/gitbook/src/components/Search/server-actions.tsx#L169> where we also fetch sources, but the code loop remains the same. If you want to just gather the final answer once all streaming is done:
const stream = api.client.orgs.streamAskInSite(organizationId, siteId,
{
question,
scope: {
mode: 'default'
}
},
{ format: 'document' },
);
let answer;
for await (const chunk of stream) {
answer = chunk.answer;
}
console.log(answer);
—
Reply to this email directly, view it on GitHub<#853 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BKPNMUR7GISRMZP3R3ZMYED2LVZ4LAVCNFSM6AAAAABVQTRS5OVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCOBZGU3TGNQ>.
You are receiving this because you were mentioned.
|
Beta Was this translation helpful? Give feedback.
-
i see the analytics for ask ai on the site level, but im wondering if there could be some way to include anayltics for questions asked via api to gitbook lens. this would be a huge thing for us as the majority of interactions to our gitbook will be via api.
thanks, and as always appreciate the response
Beta Was this translation helpful? Give feedback.
All reactions