Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LlamaIndexTS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
run-llama
LlamaIndexTS
Commits
6042d2a3
Commit
6042d2a3
authored
1 year ago
by
Marcus Schiesser
Browse files
Options
Downloads
Patches
Plain Diff
fix: don't copy backend files for frontend-only
parent
df03819e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/create-llama/create-app.ts
+3
-2
3 additions, 2 deletions
packages/create-llama/create-app.ts
packages/create-llama/templates/index.ts
+16
-10
16 additions, 10 deletions
packages/create-llama/templates/index.ts
with
19 additions
and
12 deletions
packages/create-llama/create-app.ts
+
3
−
2
View file @
6042d2a3
...
...
@@ -71,7 +71,7 @@ export async function createApp({
// install backend
const
backendRoot
=
path
.
join
(
root
,
"
backend
"
);
await
makeDir
(
backendRoot
);
await
installTemplate
({
...
args
,
root
:
backendRoot
});
await
installTemplate
({
...
args
,
root
:
backendRoot
,
backend
:
true
});
// install frontend
const
frontendRoot
=
path
.
join
(
root
,
"
frontend
"
);
await
makeDir
(
frontendRoot
);
...
...
@@ -80,6 +80,7 @@ export async function createApp({
root
:
frontendRoot
,
framework
:
"
nextjs
"
,
customApiPath
:
"
http://localhost:8000/api/chat
"
,
backend
:
false
,
});
// copy readme for fullstack
await
fs
.
promises
.
copyFile
(
...
...
@@ -87,7 +88,7 @@ export async function createApp({
path
.
join
(
root
,
"
README.md
"
),
);
}
else
{
await
installTemplate
(
args
);
await
installTemplate
(
{
...
args
,
backend
:
true
}
);
}
process
.
chdir
(
root
);
...
...
This diff is collapsed.
Click to expand it.
packages/create-llama/templates/index.ts
+
16
−
10
View file @
6042d2a3
...
...
@@ -267,7 +267,9 @@ const installPythonTemplate = async ({
);
};
export
const
installTemplate
=
async
(
props
:
InstallTemplateArgs
)
=>
{
export
const
installTemplate
=
async
(
props
:
InstallTemplateArgs
&
{
backend
:
boolean
},
)
=>
{
process
.
chdir
(
props
.
root
);
if
(
props
.
framework
===
"
fastapi
"
)
{
await
installPythonTemplate
(
props
);
...
...
@@ -275,16 +277,20 @@ export const installTemplate = async (props: InstallTemplateArgs) => {
await
installTSTemplate
(
props
);
}
// Copy the environment file to the target directory.
await
createEnvLocalFile
(
props
.
root
,
props
.
framework
,
props
.
openAIKey
);
if
(
props
.
backend
)
{
// This is a backend, so we need to copy the test data and create the env file.
// Copy test pdf file
await
copyTestData
(
props
.
root
,
props
.
framework
,
props
.
packageManager
,
props
.
engine
,
);
// Copy the environment file to the target directory.
await
createEnvLocalFile
(
props
.
root
,
props
.
framework
,
props
.
openAIKey
);
// Copy test pdf file
await
copyTestData
(
props
.
root
,
props
.
framework
,
props
.
packageManager
,
props
.
engine
,
);
}
};
export
*
from
"
./types
"
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment