-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Openai Integration #19
Comments
🤖 Hello @DM1122! It's great to see you again and I appreciate your continued contributions to our project. I'm currently looking into your issue and will get back to you with a comprehensive response shortly. |
🤖 To add the OpenAI integration feature to the tree-visualizer, you'll need to follow these steps:
Here's a rough example of what the TypeScript file might look like: import { HttpClient } from '@angular/common/http';
import { Component } from '@angular/core';
@Component({
selector: 'app-openai-integration',
templateUrl: './openai-integration.component.html',
styleUrls: ['./openai-integration.component.css']
})
export class OpenAIIntegrationComponent {
constructor(private http: HttpClient) {}
generateFeedback(token: string, node: any) {
this.http.post('https://api.openai.com/v4/engines/davinci-codex/completions', {
prompt: `Generate feedback for requirement: ${node}`,
max_tokens: 60
}, {
headers: {
'Authorization': `Bearer ${token}`
}
}).subscribe(response => {
this.postFeedbackToNotion(node, response['choices'][0]['text']);
});
}
postFeedbackToNotion(node: any, feedback: string) {
// Code to post feedback to Notion goes here
}
} Please note that this is a simplified example and doesn't include error handling or the code to post feedback to Notion. You'll need to replace You'll also need to add the new component to the parent component's HTML file where you want it to be displayed. This can be done by adding I hope this helps! Let me know if you have any questions. SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
I would like to add a feature that generates feedback for a selected requirement.
Scope:
How can this be accomplished @dosu-bot?
The text was updated successfully, but these errors were encountered: