AZ-900 Free Azure Exam Questions & Answers | AZ-900 Online Free Exam | AZ-900 Online Quiz
Welcome to the Azure 900 Certification Quiz!
- You have 50 minutes to complete 70 questions.
- The passing mark is 85%, so aim to answer at least 60 questions correctly.
- Each question is multiple-choice with only one correct answer.
- You'll receive your score along with a detailed chart showing your performance.
- After completing the quiz, you can review all questions and their respective answers.
- Make sure to submit your answers within the time limit.
- Good luck!
Test Your Skills on other Technologies 👇👇👇👇
Question | Answer Given | Correct Answer | Result |
---|
Angular Quiz for 5+ years of experience | Angular MCQ Quiz
Welcome to the Angular Quiz!
- You have 30 minutes to complete 28 questions.
- The passing mark is 85%, so aim to answer at least 24 questions correctly.
- Each question is multiple-choice with only one correct answer.
- You'll receive your score along with a detailed chart showing your performance.
- After completing the quiz, you can review all questions and their respective answers.
- Make sure to submit your answers within the time limit.
- If time is completed, you will be redirected directly to the result page.
- Good luck!
Test Your Skills on other Technologies 👇👇👇👇
Call chatgpt api from angular
Angular is a frontend framework that allows you to build web applications, and you can use it to make HTTP requests to external APIs, including the ChatGPT API.
To call the ChatGPT API from Angular, you would typically use Angular's built-in HttpClient module to send HTTP requests to the API endpoint. Here's a basic example of how you might do this:
First, make sure you have Angular CLI
installed. If not, you can install it using npm:
npm install -g @angular/cli
ng new my-chatgpt-app
Navigate to your project directory:
cd my-chatgpt-app
Generate a new service to handle API calls:
ng generate service chatgpt
In your service file (
chatgpt.service.ts
), import HttpClient
and inject it into your service constructor:import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class ChatGptService {
private apiUrl = 'https://api.openai.com/v1/chat/completions'; // Example API endpoint
constructor(private http: HttpClient) { }
getChatResponse(prompt: string): Observable<any> {
const headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY' // Replace YOUR_API_KEY with your actual API key
};
const body = {
prompt: prompt,
max_tokens: 150
};
return this.http.post<any>(this.apiUrl, body, { headers });
}
}
Replace
Replace
Now, you can use this service in your Angular components to make API calls. For example, in your component file (
'https://api.openai.com/v1/chat/completions'
with the actual URL of the ChatGPT API endpoint you want to call.Replace
'YOUR_API_KEY'
with your actual ChatGPT API key.Now, you can use this service in your Angular components to make API calls. For example, in your component file (
app.component.ts
), you can inject the ChatGptService
and call the getChatResponse
method:import { Component } from '@angular/core';
import { ChatGptService } from './chatgpt.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
constructor(private chatGptService: ChatGptService) {}
ngOnInit() {
this.chatGptService.getChatResponse('Hello, GPT!').subscribe(response => {
console.log(response);
});
}
}
Here we are printing data to the console, you can print it in an HTML page as well.
Subscribe to:
Posts (Atom)