Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
OPENAI_API_KEY=YOUR_OPENAI_API_KEY
GROQ_API_KEY=YOUR_GROQ_API_KEY
BRAVE_SEARCH_API_KEY=YOUR_BRAVE_SEARCH_API_KEY
SERPER_API=YOUR_SERPER_API
8 changes: 8 additions & 0 deletions bridge/base/0-llm-answer-engine-namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#! 0-llm-answer-engine-namespace.yaml
# Generated code, do not edit
apiVersion: v1
kind: Namespace
metadata:
name: llm-answer-engine
labels:
com.docker.compose.project: llm-answer-engine
24 changes: 24 additions & 0 deletions bridge/base/default-network-policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#! default-network-policy.yaml
# Generated code, do not edit
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-network-policy
namespace: llm-answer-engine
spec:
podSelector:
matchLabels:
com.docker.compose.network.default: "true"
policyTypes:
- Ingress
- Egress
ingress:
- from:
- podSelector:
matchLabels:
com.docker.compose.network.default: "true"
egress:
- to:
- podSelector:
matchLabels:
com.docker.compose.network.default: "true"
10 changes: 10 additions & 0 deletions bridge/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! kustomization.yaml
# Generated code, do not edit
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- 0-llm-answer-engine-namespace.yaml
- default-network-policy.yaml
- llm-answer-engine-deployment.yaml
- llm-answer-engine-expose.yaml
- llm-answer-engine-service.yaml
41 changes: 41 additions & 0 deletions bridge/base/llm-answer-engine-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#! llm-answer-engine-deployment.yaml
# Generated code, do not edit
apiVersion: apps/v1
kind: Deployment
metadata:
name: llm-answer-engine
namespace: llm-answer-engine
labels:
com.docker.compose.project: llm-answer-engine
com.docker.compose.service: llm-answer-engine
spec:
replicas: 1
selector:
matchLabels:
com.docker.compose.project: llm-answer-engine
com.docker.compose.service: llm-answer-engine
strategy:
type: Recreate
template:
metadata:
labels:
com.docker.compose.project: llm-answer-engine
com.docker.compose.service: llm-answer-engine
com.docker.compose.network.default: "true"
spec:
containers:
- name: llm-answer-engine
image: llm-answer-engine-llm-answer-engine
imagePullPolicy: IfNotPresent
env:
- name: BRAVE_SEARCH_API_KEY
value: "YOUR_BRAVE_SEARCH_API_KEY"
- name: GROQ_API_KEY
value: "YOUR_GROQ_API_KEY"
- name: OPENAI_API_KEY
value: "YOUR_OPENAI_API_KEY"
- name: SERPER_API
value: "YOUR_SERPER_API"
ports:
- name: llm-answer-3000
containerPort: 3000
18 changes: 18 additions & 0 deletions bridge/base/llm-answer-engine-expose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#! llm-answer-engine-expose.yaml
# Generated code, do not edit
apiVersion: v1
kind: Service
metadata:
name: llm-answer-engine
namespace: llm-answer-engine
labels:
com.docker.compose.project: llm-answer-engine
com.docker.compose.service: llm-answer-engine
spec:
selector:
com.docker.compose.project: llm-answer-engine
com.docker.compose.service: llm-answer-engine
ports:
- name: llm-answer-3000
port: 3000
targetPort: llm-answer-3000
21 changes: 21 additions & 0 deletions bridge/base/llm-answer-engine-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# check if there is at least one published port

#! llm-answer-engine-service.yaml
# Generated code, do not edit
apiVersion: v1
kind: Service
metadata:
name: llm-answer-engine-published
namespace: llm-answer-engine
labels:
com.docker.compose.project: llm-answer-engine
com.docker.compose.service: llm-answer-engine
spec:
selector:
com.docker.compose.project: llm-answer-engine
com.docker.compose.service: llm-answer-engine
ports:
- name: llm-answer-3000
port: 3000
protocol: TCP
targetPort: llm-answer-3000
8 changes: 8 additions & 0 deletions bridge/overlays/desktop/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#! kustomization.yaml
# Generated code, do not edit
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
patches:
- path: llm-answer-engine-service.yaml
11 changes: 11 additions & 0 deletions bridge/overlays/desktop/llm-answer-engine-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# check if there is at least one published port

#! llm-answer-engine-service.yaml
# Generated code, do not edit
apiVersion: v1
kind: Service
metadata:
name: llm-answer-engine-published
namespace: llm-answer-engine
spec:
type: LoadBalancer
12 changes: 7 additions & 5 deletions components/answer/SearchResultsComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,18 @@ const SearchResultsComponent = ({ searchResults }: { searchResults: SearchResult
);

// 11. Render the 'SearchResultsComponent'
// Only render if there are search results
if (!searchResults || searchResults.length === 0) {
return null;
}

return (
<div className="dark:bg-slate-800 bg-white shadow-lg rounded-lg p-4 mt-4">
<div className="flex items-center">
<h2 className="text-lg font-semibold flex-grow dark:text-white text-black">Sources</h2>
</div>
<div className="flex flex-wrap my-2">
{searchResults.length === 0 ? (
// 12. Render the 'SearchResultsSkeleton' if there are no search results
<SearchResultsSkeleton />
) : (
{
<>
{/* 13. Render the search results with favicon, title, and link */}
{visibleResults.map((result, index) => (
Expand Down Expand Up @@ -116,7 +118,7 @@ const SearchResultsComponent = ({ searchResults }: { searchResults: SearchResult
</div>
</div>
</>
)}
}
</div>
</div >
)
Expand Down
8 changes: 2 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
version: "3"
services:
llm-answer-engine:
build: .
environment:
- OPENAI_API_KEY=your_openai_api_key
- GROQ_API_KEY=your_groq_api_key
- BRAVE_SEARCH_API_KEY=your_brave_search_api_key
- SERPER_API=your_serper_api_key
env_file:
- .env.docker
# uncomment the following to change the default config (ollama, etc)
# volumes:
# - $PWD/app/config.tsx:/home/node/app/app/config.tsx:ro
Expand Down
Loading