Skip to content

Commit e661dc4

Browse files
committed
add time to test
1 parent 2cfb5e6 commit e661dc4

File tree

5 files changed

+95
-132
lines changed

5 files changed

+95
-132
lines changed

deploy/weaviate-k8s.yaml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: weaviate
5+
namespace: costrict
6+
labels:
7+
app: weaviate
8+
spec:
9+
replicas: 1
10+
selector:
11+
matchLabels:
12+
app: weaviate
13+
template:
14+
metadata:
15+
labels:
16+
app: weaviate
17+
spec:
18+
containers:
19+
- name: weaviate
20+
image: semitechnologies/weaviate:1.30.0
21+
ports:
22+
- containerPort: 8080
23+
name: http
24+
- containerPort: 50051
25+
name: grpc
26+
env:
27+
- name: PERSISTENCE_DATA_PATH
28+
value: "/var/lib/weaviate"
29+
- name: QUERY_DEFAULTS_LIMIT
30+
value: "-25"
31+
- name: AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED
32+
value: "true"
33+
- name: DEFAULT_VECTORIZER_MODULE
34+
value: "none"
35+
- name: ASYNC_INDEXING
36+
value: "true"
37+
- name: AUTHENTICATION_APIKEY_ENABLED
38+
value: "false"
39+
volumeMounts:
40+
- name: weaviate-data
41+
mountPath: /var/lib/weaviate
42+
volumes:
43+
- name: weaviate-data
44+
persistentVolumeClaim:
45+
claimName: weaviate-pvc
46+
---
47+
apiVersion: v1
48+
kind: Service
49+
metadata:
50+
name: weaviate-service
51+
namespace: costrict
52+
labels:
53+
app: weaviate
54+
spec:
55+
type: NodePort
56+
ports:
57+
- port: 8080
58+
targetPort: 8080
59+
protocol: TCP
60+
name: http
61+
nodePort: 32003
62+
- port: 50051
63+
targetPort: 50051
64+
protocol: TCP
65+
name: grpc
66+
nodePort: 32004
67+
selector:
68+
app: weaviate
69+
---
70+
apiVersion: v1
71+
kind: PersistentVolumeClaim
72+
metadata:
73+
name: weaviate-pvc
74+
namespace: costrict
75+
labels:
76+
app: weaviate
77+
spec:
78+
accessModes:
79+
- ReadWriteOnce
80+
resources:
81+
requests:
82+
storage: 10Gi
83+
storageClassName: standard

internal/embedding/splitter.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ func (p *CodeSplitter) Split(codeFile *types.SourceFile) ([]*types.CodeChunk, er
9393
allChunks = append(allChunks, subChunks...)
9494
} else {
9595
allChunks = append(allChunks, &types.CodeChunk{
96+
Language: "code",
9697
CodebaseId: codeFile.CodebaseId,
9798
CodebasePath: codeFile.CodebasePath,
9899
CodebaseName: codeFile.CodebaseName,
@@ -210,6 +211,7 @@ func (p *CodeSplitter) splitFuncWithSlidingWindow(content string, codeFile *type
210211
endColumn := calculateColumn(content[startByte:endByte+1], endByte-startByte)
211212

212213
chunks = append(chunks, &types.CodeChunk{
214+
Language: "code",
213215
CodebaseId: codeFile.CodebaseId,
214216
CodebasePath: codeFile.CodebasePath,
215217
CodebaseName: codeFile.CodebaseName,
@@ -302,6 +304,7 @@ func (p *CodeSplitter) splitMarkdownFile(codeFile *types.SourceFile) ([]*types.C
302304
tokenCount := p.countToken([]byte(chunkContent))
303305

304306
chunks = append(chunks, &types.CodeChunk{
307+
Language: "markdown",
305308
CodebaseId: codeFile.CodebaseId,
306309
CodebasePath: codeFile.CodebasePath,
307310
CodebaseName: codeFile.CodebaseName,
@@ -320,6 +323,7 @@ func (p *CodeSplitter) splitMarkdownFile(codeFile *types.SourceFile) ([]*types.C
320323
tokenCount := p.countToken([]byte(chunkContent))
321324

322325
chunks = append(chunks, &types.CodeChunk{
326+
Language: "markdown",
323327
CodebaseId: codeFile.CodebaseId,
324328
CodebasePath: codeFile.CodebasePath,
325329
CodebaseName: codeFile.CodebaseName,
@@ -347,6 +351,7 @@ func (p *CodeSplitter) splitMarkdownFile(codeFile *types.SourceFile) ([]*types.C
347351
tokenCount := p.countToken([]byte(chunkContent))
348352

349353
chunks = append(chunks, &types.CodeChunk{
354+
Language: "markdown",
350355
CodebaseId: codeFile.CodebaseId,
351356
CodebasePath: codeFile.CodebasePath,
352357
CodebaseName: codeFile.CodebaseName,
@@ -386,6 +391,7 @@ func (p *CodeSplitter) splitMarkdownFile(codeFile *types.SourceFile) ([]*types.C
386391
tokenCount := p.countToken([]byte(chunkContent))
387392

388393
chunks = append(chunks, &types.CodeChunk{
394+
Language: "markdown",
389395
CodebaseId: codeFile.CodebaseId,
390396
CodebasePath: codeFile.CodebasePath,
391397
CodebaseName: codeFile.CodebaseName,

0 commit comments

Comments
 (0)