Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
product_recommendation_chatbot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bhargava Rellu
product_recommendation_chatbot
Commits
33089a85
Commit
33089a85
authored
Jan 28, 2025
by
Bhargava Rellu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
0c63c8ce
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
11 deletions
+14
-11
routes.cpython-310.pyc
src/reviewsense/api/__pycache__/routes.cpython-310.pyc
+0
-0
routes.py
src/reviewsense/api/routes.py
+0
-8
product_review_input.cpython-310.pyc
.../schemas/__pycache__/product_review_input.cpython-310.pyc
+0
-0
product_review_input.py
src/reviewsense/api/schemas/product_review_input.py
+5
-3
main.py
src/reviewsense/main.py
+9
-0
No files found.
src/reviewsense/api/__pycache__/routes.cpython-310.pyc
View file @
33089a85
No preview for this file type
src/reviewsense/api/routes.py
View file @
33089a85
...
@@ -7,14 +7,6 @@ from reviewsense.services.ReviewService import ReviewService
...
@@ -7,14 +7,6 @@ from reviewsense.services.ReviewService import ReviewService
router
=
APIRouter
()
router
=
APIRouter
()
review_service
=
ReviewService
()
review_service
=
ReviewService
()
app
.
add_middleware
(
CORSMiddleware
,
allow_origins
=
[
"http://localhost:3000"
],
allow_credentials
=
True
,
allow_methods
=
[
"*"
],
allow_headers
=
[
"*"
],
)
@
router
.
post
(
"/calculate_ratings/"
,
response_model
=
Dict
[
str
,
Optional
[
float
]])
@
router
.
post
(
"/calculate_ratings/"
,
response_model
=
Dict
[
str
,
Optional
[
float
]])
async
def
calculate_ratings
(
input_data
:
ProductReviewInput
):
async
def
calculate_ratings
(
input_data
:
ProductReviewInput
):
"""
"""
...
...
src/reviewsense/api/schemas/__pycache__/product_review_input.cpython-310.pyc
View file @
33089a85
No preview for this file type
src/reviewsense/api/schemas/product_review_input.py
View file @
33089a85
...
@@ -15,9 +15,11 @@ class ProductReviewInput(BaseModel):
...
@@ -15,9 +15,11 @@ class ProductReviewInput(BaseModel):
"""Pydantic model configuration"""
"""Pydantic model configuration"""
json_schema_extra
=
{
json_schema_extra
=
{
"example"
:
{
"example"
:
{
"product_id"
:
"iPhone 15 Pro Max"
,
# "product_id": "iPhone 15 Pro Max",
"features"
:
[
"camera"
,
"battery"
],
"product_id"
:
""
,
"new_review"
:
"Great phone with excellent battery life!"
,
"features"
:
[
"camera"
,
"battery"
,
"display"
,
"design"
],
# "new_review": "Great phone with excellent battery life!",
"new_review"
:
""
,
"is_rating_evaluation_required"
:
True
"is_rating_evaluation_required"
:
True
}
}
}
}
\ No newline at end of file
src/reviewsense/main.py
View file @
33089a85
from
fastapi
import
FastAPI
from
fastapi
import
FastAPI
from
reviewsense.api.routes
import
router
from
reviewsense.api.routes
import
router
from
reviewsense.core.config
import
get_settings
from
reviewsense.core.config
import
get_settings
from
fastapi.middleware.cors
import
CORSMiddleware
def
create_app
()
->
FastAPI
:
def
create_app
()
->
FastAPI
:
"""
"""
...
@@ -21,6 +22,14 @@ def create_app() -> FastAPI:
...
@@ -21,6 +22,14 @@ def create_app() -> FastAPI:
app
=
create_app
()
app
=
create_app
()
app
.
add_middleware
(
CORSMiddleware
,
allow_origins
=
[
"http://localhost:3000"
],
allow_credentials
=
True
,
allow_methods
=
[
"*"
],
allow_headers
=
[
"*"
],
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
import
uvicorn
import
uvicorn
uvicorn
.
run
(
app
,
host
=
'0.0.0.0'
,
port
=
8000
)
uvicorn
.
run
(
app
,
host
=
'0.0.0.0'
,
port
=
8000
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment