Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Create Llama
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
Create Llama
Commits
cd6ebf72
Commit
cd6ebf72
authored
9 months ago
by
Marcus Schiesser
Browse files
Options
Downloads
Patches
Plain Diff
dx: add hint if tool config is needed
parent
50b2ddbb
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
helpers/tools.ts
+7
-1
7 additions, 1 deletion
helpers/tools.ts
questions.ts
+6
-2
6 additions, 2 deletions
questions.ts
with
13 additions
and
3 deletions
helpers/tools.ts
+
7
−
1
View file @
cd6ebf72
...
@@ -173,9 +173,15 @@ export const getTools = (toolsName: string[]): Tool[] => {
...
@@ -173,9 +173,15 @@ export const getTools = (toolsName: string[]): Tool[] => {
return
tools
;
return
tools
;
};
};
export
const
toolRequiresConfig
=
(
tool
:
Tool
):
boolean
=>
{
const
hasConfig
=
Object
.
keys
(
tool
.
config
||
{}).
length
>
0
;
const
hasEmptyEnvVar
=
tool
.
envVars
?.
some
((
envVar
)
=>
!
envVar
.
value
)
??
false
;
return
hasConfig
||
hasEmptyEnvVar
;
};
export
const
toolsRequireConfig
=
(
tools
?:
Tool
[]):
boolean
=>
{
export
const
toolsRequireConfig
=
(
tools
?:
Tool
[]):
boolean
=>
{
if
(
tools
)
{
if
(
tools
)
{
return
tools
?.
some
(
(
tool
)
=>
Object
.
keys
(
tool
.
config
||
{}).
length
>
0
);
return
tools
?.
some
(
tool
RequiresConfig
);
}
}
return
false
;
return
false
;
};
};
...
...
This diff is collapsed.
Click to expand it.
questions.ts
+
6
−
2
View file @
cd6ebf72
...
@@ -16,7 +16,11 @@ import { templatesDir } from "./helpers/dir";
...
@@ -16,7 +16,11 @@ import { templatesDir } from "./helpers/dir";
import
{
getAvailableLlamapackOptions
}
from
"
./helpers/llama-pack
"
;
import
{
getAvailableLlamapackOptions
}
from
"
./helpers/llama-pack
"
;
import
{
askModelConfig
}
from
"
./helpers/providers
"
;
import
{
askModelConfig
}
from
"
./helpers/providers
"
;
import
{
getProjectOptions
}
from
"
./helpers/repo
"
;
import
{
getProjectOptions
}
from
"
./helpers/repo
"
;
import
{
supportedTools
,
toolsRequireConfig
}
from
"
./helpers/tools
"
;
import
{
supportedTools
,
toolRequiresConfig
,
toolsRequireConfig
,
}
from
"
./helpers/tools
"
;
export
type
QuestionArgs
=
Omit
<
export
type
QuestionArgs
=
Omit
<
InstallAppArgs
,
InstallAppArgs
,
...
@@ -652,7 +656,7 @@ export const askQuestions = async (
...
@@ -652,7 +656,7 @@ export const askQuestions = async (
t
.
supportedFrameworks
?.
includes
(
program
.
framework
),
t
.
supportedFrameworks
?.
includes
(
program
.
framework
),
);
);
const
toolChoices
=
options
.
map
((
tool
)
=>
({
const
toolChoices
=
options
.
map
((
tool
)
=>
({
title
:
tool
.
display
,
title
:
`
${
tool
.
display
}${
toolRequiresConfig
(
tool
)
?
""
:
"
(no config needed)
"
}
`
,
value
:
tool
.
name
,
value
:
tool
.
name
,
}));
}));
const
{
toolsName
}
=
await
prompts
({
const
{
toolsName
}
=
await
prompts
({
...
...
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