Skip to content

Commit

Permalink
Updated ReadMe and fix log
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-swapnildixit committed Jul 3, 2024
1 parent 2edd049 commit 24f90a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![CI/CD Pipeline](https://github.com/NashTech-Labs/Blogs-Analyzer/actions/workflows/maven.yml/badge.svg)](https://github.com/NashTech-Labs/Blogs-Analyzer/actions/workflows/maven.yml)

Blogs-Analyzer Backend is a Spring Boot application designed to search blogs from WordPress APIs based on username, blog
ID, or text. Additionally, it integrates with Vertex AI to analyze the quality of blog posts using machine learning.
ID, or text. Additionally, it integrates with Gemini to analyze the quality of blog posts using machine learning.
Blogs-Analyzer-UI is an Angular application used to display the results on a user interface or dashboard.

## Table of Contents
Expand Down Expand Up @@ -39,7 +39,7 @@ Before starting, ensure you have the following installed and configured:
| Node.js | 18.x |
| Maven | 3.9+ |
| Google Cloud SDK | Latest |
| Vertex AI | Latest |
| Gemini | Latest |
| WordPress API | Latest |


Expand All @@ -54,8 +54,7 @@ Before starting, ensure you have the following installed and configured:
## Dependencies

- **Spring Boot**: The core framework for building the backend application.
- **Vertex AI Client**: Used for integrating with Vertex AI for blog quality analysis. Ensure the necessary
configurations and credentials are set up to communicate with Vertex AI APIs.
- **Gemini Client**: Used for integrating with Gemini for blog quality analysis. Ensure the necessary configurations and credentials are set up to communicate with Gemini APIs.
- **WordPress API Client**: Allows communication with WordPress APIs to fetch blog data based on username, blog ID, or
text.

Expand Down Expand Up @@ -84,7 +83,7 @@ Before starting, ensure you have the following installed and configured:
name, and author id.

6. #### Analyze Blog Quality
- `POST /api/gemini/v1/review` This endpoint analyzes the quality of a blog post using Vertex AI. It requires a JSON
- `POST /api/gemini/v1/review` This endpoint analyzes the quality of a blog post using Gemini. It requires a JSON
payload with blog content.

## Running the application:
Expand Down Expand Up @@ -115,6 +114,6 @@ Once the application is running locally, you can access the API endpoints using
Verify API functionality:

Use the endpoints mentioned in the Endpoints section to verify functionality and interaction with WordPress APIs and
Vertex AI.
Gemini.


10 changes: 5 additions & 5 deletions blogs-analyzer-ui/src/app/services/blog.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class BlogService {
const url = `${this.baseUrl}/wordpress/posts-by-title?title=${encodeURIComponent(title)}`;
this.logger.debug(`BlogService :: Fetching post by Title: ${title} :: URL: ${url}`);
return this.http.get(url, {responseType: 'text'}).pipe(
catchError(this.handleError)
catchError(this.handleError.bind(this))
);
}

Expand All @@ -30,31 +30,31 @@ export class BlogService {
posts: response.posts,
totalPages: response.totalPages
})),
catchError(this.handleError)
catchError(this.handleError.bind(this))
);
}

getPostById(id: number): Observable<any> {
const url = `${this.baseUrl}/wordpress/posts/${id}`;
this.logger.debug(`BlogService :: Fetching post by Blog ID: ${id} :: URL: ${url}`);
return this.http.get(url, {responseType: 'text'}).pipe(
catchError(this.handleError)
catchError(this.handleError.bind(this))
);
}

getPostByAuthorId(id: number): Observable<any> {
const url = `${this.baseUrl}/wordpress/posts-by-author?authorId=${id}`;
this.logger.debug(`BlogService :: Fetching post by Author ID: ${id} :: URL: ${url}`);
return this.http.get(url, {responseType: 'text'}).pipe(
catchError(this.handleError)
catchError(this.handleError.bind(this))
);
}

getBlogQuality(prompt: string): Observable<any> {
const url = `${this.baseUrl}/gemini/v1/review`;
this.logger.debug(`BlogService :: Checking Blog's Quality with prompt ${prompt} :: URL: ${url}`);
return this.http.post(url, prompt, {responseType: 'text'}).pipe(
catchError(this.handleError)
catchError(this.handleError.bind(this))
);
}

Expand Down

0 comments on commit 24f90a0

Please sign in to comment.