openai gpt Assistant api, or embeddings template? How to select version when git cloning?
Hey when i git clone the project i get the ai gpt scheduler/task manager as the openai demoapp page template. (as said in earlier question I dont get the latest version of the code running: wasp start > selecting 1-4 templates (static, todo, saas, embeddings?). But i would want to have the openai template that was in that version, and also use the embeddings?
Alternatively, or also a new template using the openai gpt Assistants api would be great. SInce that has built in embedding vector search context. But Could i at least get the latest code with the template that is in wasp start template Saas? This is not a schedule/task manager but was more of a chat with gpt.
![No description](https://cdn.answeroverflow.com/1196844630604525778/2024-01-16_16_52_15-nurium_saas5_Brave.png)
27 Replies
if i can get this template but on the latest code, since i guess it can mess stuff up if i just copy from an older version? Ill try and port i guess.
~~~~~~~~~~
also im trying myself to use the gpt assistant api but im not sure how to import openai into the actions.ts file, the new Assistant api code doesnt seem to work in actions.ts file.
@Vinny (@Wasp) could you take a look at this?
@Nurium you can find it in the old version of the Saas template https://github.com/wasp-lang/SaaS-Template-GPT
you'll specifically want the
client/GptPage.tsx
and the associated actions in server/actions.ts
https://github.com/wasp-lang/SaaS-Template-GPT/blob/master/src/server/actions.ts#L71-L148i tried to port it but didnt work
from the version i dl the other day, ill try with the git link
since there is a change in the other code
you just want to copy and paste the client code from
GptPage
into the DemoAppPage
on the new tempalte
as well as the actionsoh ok
in the links above
got it, seems my own version might have older code, at least the stripe logic
i don't think the stripe logic really relates to the GPT generation. As long as the
user.hasPaid
property is true, it will workseems i used my own client ui, ill try the original as u said
[Server!] HttpError: Bad response from OpenAI
[Server!] at generateGptResponse (file:///home/nurium_ubuntu/Projects/tezty/open-saas/app/.wasp/out/server/dist/ext-src/actions.js:88:19)
[Server!] at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[Server!] at async file:///home/nurium_ubuntu/Projects/tezty/open-saas/app/.wasp/out/server/dist/middleware/operations.js:9:24
[Server!] at async file:///home/nurium_ubuntu/Projects/tezty/open-saas/app/.wasp/out/server/dist/utils.js:15:9 {
[Server!] statusCode: 500
[Server!] }
[Server] POST /operations/generate-gpt-response 500 1839.256 ms - 38
not sure im replacing the right code:
"[Server] src/ext-src/actions.ts(68,67): error TS2304: Cannot find name 'RelatedObject'.
[Server] src/ext-src/actions.ts(116,45): error TS2304: Cannot find name 'OpenAIResponse'.
[Server] src/ext-src/actions.ts(118,29): error TS2339: Property 'RelatedObject' does not exist on type '{ User: UserDelegate<RejectOnNotFound | RejectPerOperation, DefaultArgs>; GptResponse: GptResponseDelegate<RejectOnNotFound | RejectPerOperation, DefaultArgs>; Task: TaskDelegate<...>; }'."
make sure you update the actions in your
main.wasp
file, along with the proper related entitiesoh ok