Skip to content

Commit

Permalink
ChatGPT July 20 Version
Browse files Browse the repository at this point in the history
  • Loading branch information
gcslaoli committed Jul 21, 2023
1 parent 95e029b commit ebad769
Show file tree
Hide file tree
Showing 27 changed files with 40,442 additions and 45,094 deletions.
143 changes: 69 additions & 74 deletions api/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,48 +12,45 @@ func Index(r *ghttp.Request) {
r.Response.RedirectTo("/login")
return
}
model := r.Get("model").String()
props := `
{
"props": {
"pageProps": {
"user": {
"id": "user-HUagcZWRoCLaYBjUWal6Ax9b",
"name": "admin",
"email": "[email protected]",
"image": "",
"picture": "",
"idp": "auth0",
"iat": 2684985735,
"mfa": false,
"groups": [],
"intercom_hash": "f4ded2c9ed2ba48edf71cea6c54a290a865faed484eb07c4e663c90c00a66f65"
},
"serviceStatus": {},
"userCountry": "US",
"geoOk": true,
"serviceAnnouncement": {
"paid": {},
"public": {}
},
"isUserInCanPayGroup": true,
"_sentryTraceData": "b8d327b969c64290bc9daca0ca255d6d-85fc20e54d888cea-1",
"_sentryBaggage": "sentry-environment=production,sentry-release=5593c6f6aa15c68df3ba79cee2239262faee3022,sentry-transaction=%2F,sentry-public_key=33f79e998f93410882ecec1e57143840,sentry-trace_id=b8d327b969c64290bc9daca0ca255d6d,sentry-sample_rate=1"
},
"__N_SSP": true
},
"page": "/",
"query": {},
"buildId": "MYarkpkg17PeZHlffaxc-",
"isFallback": false,
"gssp": true,
"scriptLoader": []
}
`
{
"props": {
"pageProps": {
"user": {
"id": "user-HUagcZWRoCLaYBjUWal6Ax9b",
"name": "[email protected]",
"email": "[email protected]",
"image": "https://s.gravatar.com/avatar/e3602eeb8e3136bf37808604da5ba1d6?s=480\u0026r=pg\u0026d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fcn.png",
"picture": "https://s.gravatar.com/avatar/e3602eeb8e3136bf37808604da5ba1d6?s=480\u0026r=pg\u0026d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fcn.png",
"idp": "auth0",
"iat": 1689474424,
"mfa": false,
"groups": [],
"intercom_hash": "f4ded2c9ed2ba48edf71cea6c54a290a865faed484eb07c4e663c90c00a66f65"
},
"serviceStatus": {},
"userCountry": "JP",
"geoOk": true,
"serviceAnnouncement": { "public": {}, "paid": {} },
"isUserInCanPayGroup": true,
"_sentryTraceData": "8ae977dd68be4a2294ff41e07ee64f18-8270fa23f457a348-1",
"_sentryBaggage": "sentry-environment=production,sentry-release=3a086bf213a0eb4a539a25373d4fb7e214c61f07,sentry-transaction=%2F,sentry-public_key=33f79e998f93410882ecec1e57143840,sentry-trace_id=8ae977dd68be4a2294ff41e07ee64f18,sentry-sample_rate=1"
},
"__N_SSP": true
},
"page": "/",
"query": {},
"buildId": "8TObkIccovI1-nluVgBpN",
"isFallback": false,
"gssp": true,
"scriptLoader": []
}`
propsJson := gjson.New(props)
propsJson.Set("query.model", model)

r.Response.WriteTpl("chat.html", g.Map{
"props": props,
"pandora_sentry": false,
"api_prefix": "",
"props": propsJson,
})
}

Expand All @@ -67,44 +64,42 @@ func C(r *ghttp.Request) {
g.Log().Debug(r.GetCtx(), "chatId", chatId)
props := `
{
"props": {
"pageProps": {
"user": {
"id": "user-HUagcZWRoCLaYBjUWal6Ax9b",
"name": "admin",
"email": "[email protected]",
"image": "https://s.gravatar.com/avatar/e3602eeb8e3136bf37808604da5ba1d6?s=480\u0026r=pg\u0026d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fcn.png",
"picture": "https://s.gravatar.com/avatar/e3602eeb8e3136bf37808604da5ba1d6?s=480\u0026r=pg\u0026d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fcn.png",
"idp": "auth0",
"iat": 1685028161,
"mfa": false,
"groups": [],
"intercom_hash": "f4ded2c9ed2ba48edf71cea6c54a290a865faed484eb07c4e663c90c00a66f65"
},
"serviceStatus": {},
"userCountry": "US",
"geoOk": true,
"serviceAnnouncement": { "paid": {}, "public": {} },
"isUserInCanPayGroup": true,
"_sentryTraceData": "9635e8a5ed8d42d694b65a665ffeab2a-b4bd3c4464a5db64-1",
"_sentryBaggage": "sentry-environment=production,sentry-release=5593c6f6aa15c68df3ba79cee2239262faee3022,sentry-transaction=%2Fc%2F%5BchatId%5D,sentry-public_key=33f79e998f93410882ecec1e57143840,sentry-trace_id=9635e8a5ed8d42d694b65a665ffeab2a,sentry-sample_rate=1"
},
"__N_SSP": true
},
"page": "/c/[chatId]",
"query": { "chatId": "b242a52c-2038-473b-8c46-5a141879203a" },
"buildId": "MYarkpkg17PeZHlffaxc-",
"isFallback": false,
"gssp": true,
"scriptLoader": []
}
"props": {
"pageProps": {
"user": {
"id": "user-HUagcZWRoCLaYBjUWal6Ax9b",
"name": "admin@openai.com",
"email": "[email protected]",
"image": "https://s.gravatar.com/avatar/e3602eeb8e3136bf37808604da5ba1d6?s=480\u0026r=pg\u0026d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fcn.png",
"picture": "https://s.gravatar.com/avatar/e3602eeb8e3136bf37808604da5ba1d6?s=480\u0026r=pg\u0026d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fcn.png",
"idp": "auth0",
"iat": 1689474424,
"mfa": false,
"groups": [],
"intercom_hash": "f4ded2c9ed2ba48edf71cea6c54a290a865faed484eb07c4e663c90c00a66f65"
},
"serviceStatus": {},
"userCountry": "JP",
"geoOk": true,
"serviceAnnouncement": { "paid": {}, "public": {} },
"isUserInCanPayGroup": true,
"_sentryTraceData": "e5db5813b133420392e225c2a490765d-8633d434a35afd92-1",
"_sentryBaggage": "sentry-environment=production,sentry-release=3a086bf213a0eb4a539a25373d4fb7e214c61f07,sentry-transaction=%2Fc%2F%5BchatId%5D,sentry-public_key=33f79e998f93410882ecec1e57143840,sentry-trace_id=e5db5813b133420392e225c2a490765d,sentry-sample_rate=1"
},
"__N_SSP": true
},
"page": "/c/[chatId]",
"query": { "chatId": "8f6c608a-642c-4a32-8519-f9bf633bb54a" },
"buildId": "8TObkIccovI1-nluVgBpN",
"isFallback": false,
"gssp": true,
"scriptLoader": []
}
`
propsJson := gjson.New(props)
propsJson.Set("query.chatId", chatId)
g.Dump(propsJson)

r.Response.WriteTpl("detail.html", g.Map{
"props": propsJson,
"pandora_sentry": false,
"api_prefix": "",
"props": propsJson,
})
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Large diffs are not rendered by default.

This file was deleted.

Loading

0 comments on commit ebad769

Please sign in to comment.