Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/Gurubase/gurubase into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
aralyekta committed Feb 7, 2025
2 parents 8a5a53b + 1366a65 commit f5164ca
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 95 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.2] - 2025-02-07

### Bug Fixes
- Fix backend init error by checking the github collection exists. Fixes [#86](https://github.com/Gurubase/gurubase/issues/86).


## [0.1.1] - 2025-01-22

### Added
### Bug Fixes
- Fix Binge graph. In some cases, the nodes are not visible.

## [0.1.0] - 2025-01-21
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ curl -fsSL https://raw.githubusercontent.com/Gurubase/gurubase/refs/heads/master
bash gurubase.sh
```

See [INSTALL.md](INSTALL.md) for detailed installation instructions and prerequisites.
See [INSTALL.md](INSTALL.md) for detailed installation instructions like [upgrading](INSTALL.md#upgrade), [uninstalling](INSTALL.md#remove), and more.

## How to Create a Guru

Expand Down
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ services:
restart: always

backend:
image: ddosify/gurubase-backend:0.1.0
image: ddosify/gurubase-backend:0.1.2
container_name: gurubase-backend
command: /workspace/start_scripts/start_app_selfhosted.sh
env_file:
Expand All @@ -72,7 +72,7 @@ services:
pull_policy: always

celery-worker-1:
image: ddosify/gurubase-backend:0.1.0
image: ddosify/gurubase-backend:0.1.2
container_name: gurubase-backend-celery-worker-1
command: /workspace/start_scripts/start_celery_worker.sh
env_file:
Expand All @@ -83,7 +83,7 @@ services:
pull_policy: always

celery-worker-2:
image: ddosify/gurubase-backend:0.1.0
image: ddosify/gurubase-backend:0.1.2
container_name: gurubase-backend-celery-worker-2
command: /workspace/start_scripts/start_celery_worker.sh
env_file:
Expand All @@ -94,7 +94,7 @@ services:
pull_policy: always

celery-worker-3:
image: ddosify/gurubase-backend:0.1.0
image: ddosify/gurubase-backend:0.1.2
container_name: gurubase-backend-celery-worker-3
command: /workspace/start_scripts/start_celery_worker.sh
env_file:
Expand All @@ -105,7 +105,7 @@ services:
pull_policy: always

celery-beat:
image: ddosify/gurubase-backend:0.1.0
image: ddosify/gurubase-backend:0.1.2
container_name: gurubase-backend-celery-beat
command: /workspace/start_scripts/start_celery_beat.sh
env_file:
Expand Down
3 changes: 3 additions & 0 deletions src/gurubase-backend/backend/core/milvus_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ def create_context_collection(collection_name):
print(f'Created collection {collection_name}')

def create_code_context_collection(collection_name):

if client.has_collection(collection_name):
return
# 1. Create schema
schema = MilvusClient.create_schema(
auto_id=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,7 @@ import { useState, useEffect } from "react";
import { useStatCards, useHistogram, useTableData } from "@/hooks/useAnalytics";
import { METRIC_TYPES } from "@/services/analyticsService";
import { useRouter, useSearchParams } from "next/navigation";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger
} from "@/components/ui/tooltip";
import { SolarInfoCircleBold } from "@/components/Icons";

const HeaderTooltip = ({ text }) => {
return (
<div className="ml-2">
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<div className="cursor-pointer">
<SolarInfoCircleBold className="h-4 w-4 text-gray-200" />
</div>
</TooltipTrigger>
<TooltipContent>
<p className="text-[12px] font-medium">{text}</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</div>
);
};
import { HeaderTooltip } from "@/components/ui/header-tooltip";

const MetricSection = ({
title,
Expand Down Expand Up @@ -218,7 +193,7 @@ const AnalyticsContent = ({ customGuru, initialInterval }) => {

<MetricSection
title="Unable to Answers"
tooltipText="Questions that cannot be answered. The reason could be that the question is unrelated to the Guru, or the Gurus data source is insufficient to generate an answer."
tooltipText="Questions that cannot be answered. The reason could be that the question is unrelated to the Guru, or the Guru's data source is insufficient to generate an answer."
metricType={METRIC_TYPES.OUT_OF_CONTEXT}
interval={interval}
guruType={guruType}
Expand Down
80 changes: 19 additions & 61 deletions src/gurubase-frontend/src/components/NewGuru.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ import {
TooltipProvider,
TooltipTrigger
} from "./ui/tooltip";
import { HeaderTooltip } from "@/components/ui/header-tooltip";

const formSchema = z.object({
guruName: z
Expand Down Expand Up @@ -1771,22 +1772,11 @@ export default function NewGuru({
<FormItem className="flex-1">
<div className="flex items-center space-x-2">
<FormLabel>Codebase Indexing</FormLabel>
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<div>
<SolarInfoCircleBold className="h-4 w-4 text-gray-200" />
</div>
</TooltipTrigger>
<TooltipContent>
<p>
Provide a link to a GitHub repository to index its
codebase. The Guru can then use this codebase to generate
answers based on it.
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
<HeaderTooltip
text={
"Provide a link to a GitHub repository to index its codebase. The Guru can then use this codebase to generate answers based on it."
}
/>
</div>
<div className="relative">
<FormControl>
Expand Down Expand Up @@ -1905,22 +1895,13 @@ export default function NewGuru({
<FormLabel>
Guru Name <span className="text-red-500">*</span>
</FormLabel>
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<div>
<SolarInfoCircleBold className="h-4 w-4 text-gray-200" />
</div>
</TooltipTrigger>
<TooltipContent>
<p>
{isEditMode
? "Guru name cannot be changed"
: "Enter the name of your AI guru"}
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
<HeaderTooltip
text={
isEditMode
? "Guru name cannot be changed"
: "Enter the name of your AI guru"
}
/>
</div>
<FormControl>
<Input
Expand Down Expand Up @@ -1955,18 +1936,7 @@ export default function NewGuru({
<FormLabel>
Guru Logo <span className="text-red-500">*</span>
</FormLabel>
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<div>
<SolarInfoCircleBold className="h-4 w-4 text-gray-200" />
</div>
</TooltipTrigger>
<TooltipContent>
<p>{"Guru logo"}</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
<HeaderTooltip text={"Guru logo"} />
</div>
<FormControl>
<div className="flex items-center space-x-4">
Expand Down Expand Up @@ -2053,23 +2023,11 @@ export default function NewGuru({
<FormLabel>
Topics <span className="text-red-500">*</span>
</FormLabel>
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<div>
<SolarInfoCircleBold className="h-4 w-4 text-gray-200" />
</div>
</TooltipTrigger>
<TooltipContent className="max-w-[280px]">
<p>
Add comma-separated topics related to this Guru,
e.g., &quot;programming, microservices,
containers&quot;. This helps the AI understand the
Guru&apos;s expertise and context.
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
<HeaderTooltip
text={
'Add comma-separated topics related to this Guru, e.g., "programming, microservices, containers". This helps the AI understand the Guru\'s expertise and context.'
}
/>
</div>
<FormControl>
<Input
Expand Down
63 changes: 63 additions & 0 deletions src/gurubase-frontend/src/components/ui/header-tooltip.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
"use client";

import { useState, useEffect } from "react";
import { SolarInfoCircleBold } from "@/components/Icons";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger
} from "@/components/ui/tooltip";

export const HeaderTooltip = ({ text }) => {
const [isOpen, setIsOpen] = useState(false);

useEffect(() => {
const handleClickOutside = (event) => {
if (!event.target.closest("[data-tooltip-trigger]")) {
setIsOpen(false);
}
};

// Handle both touch and click events
document.addEventListener("click", handleClickOutside);
document.addEventListener("touchend", handleClickOutside);

return () => {
document.removeEventListener("click", handleClickOutside);
document.removeEventListener("touchend", handleClickOutside);
};
}, []);

const handleInteraction = (e) => {
e.preventDefault();
e.stopPropagation();

// Check if it's a mobile device
const isMobile = window.matchMedia("(max-width: 768px)").matches;
if (isMobile) {
setIsOpen(!isOpen);
}
};

return (
<div className="ml-2">
<TooltipProvider>
<Tooltip open={isOpen} onOpenChange={setIsOpen}>
<TooltipTrigger
asChild
data-tooltip-trigger
onClick={handleInteraction}
onTouchEnd={handleInteraction}>
<div>
<SolarInfoCircleBold className="h-4 w-4 text-gray-200" />
</div>
</TooltipTrigger>
<TooltipContent side="top" align="center" className="z-50">
<p className="text-[12px] font-medium max-w-[400px]">{text}</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</div>
);
};

0 comments on commit f5164ca

Please sign in to comment.