fix(ollama): resolve model list loading issue and add Pytest for component testing (#3575)
* Commit to solve Model not loading issue The issue was that the url of the models: api/tags was not parsed correctly. It was having a // hence used urlencode to parse it properly. Th e correct apporach works only if the base_url is correct,i.e a valid ollama URL: for DS LF this must be a public ollama Server URL. * updated the component Ollama Component changed the get model to take in base url and the function will make the expected url for the model names. This makes the function better, than providing the model url as paramter. Added Pytest, 7 tests, 1 test excluded for future implememtstion: test_build_model_failure Make lint and Make format had touched multiple files * removed unwanted print statements removed unwanted print statements. make format, formatted a lot of .tsx files also * removed skipped tests * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
3222153938
commit
46a9789028
13 changed files with 3122 additions and 1371 deletions
4331
src/frontend/package-lock.json
generated
4331
src/frontend/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -6,5 +6,5 @@ export default function getFieldTitle(
|
|||
): string {
|
||||
return template[templateField].display_name
|
||||
? template[templateField].display_name!
|
||||
: template[templateField].name ?? templateField;
|
||||
: (template[templateField].name ?? templateField);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,4 +48,4 @@ const CheckBoxDiv = ({
|
|||
</div>
|
||||
);
|
||||
|
||||
export { CheckBoxDiv, Checkbox };
|
||||
export { Checkbox, CheckBoxDiv };
|
||||
|
|
|
|||
|
|
@ -296,4 +296,4 @@ async function performStreamingRequest({
|
|||
}
|
||||
}
|
||||
|
||||
export { ApiInterceptor, api, performStreamingRequest };
|
||||
export { api, ApiInterceptor, performStreamingRequest };
|
||||
|
|
|
|||
|
|
@ -256,9 +256,9 @@ export default function IOFieldView({
|
|||
pagination={!left}
|
||||
rows={
|
||||
Array.isArray(flowPoolNode?.data?.artifacts)
|
||||
? flowPoolNode?.data?.artifacts?.map(
|
||||
? (flowPoolNode?.data?.artifacts?.map(
|
||||
(artifact) => artifact.data,
|
||||
) ?? []
|
||||
) ?? [])
|
||||
: [flowPoolNode?.data?.artifacts]
|
||||
}
|
||||
columnMode="union"
|
||||
|
|
|
|||
|
|
@ -131,8 +131,8 @@ export default function PromptModal({
|
|||
field_name = Array.isArray(
|
||||
apiReturn?.frontend_node?.custom_fields?.[""],
|
||||
)
|
||||
? apiReturn?.frontend_node?.custom_fields?.[""][0] ?? ""
|
||||
: apiReturn?.frontend_node?.custom_fields?.[""] ?? "";
|
||||
? (apiReturn?.frontend_node?.custom_fields?.[""][0] ?? "")
|
||||
: (apiReturn?.frontend_node?.custom_fields?.[""] ?? "");
|
||||
}
|
||||
if (apiReturn) {
|
||||
let inputVariables = apiReturn.input_variables ?? [];
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ export default function NodeToolbarComponent({
|
|||
function minimize() {
|
||||
if (isMinimal) {
|
||||
setShowState((show) => !show);
|
||||
setShowNode(data.showNode ?? true ? false : true);
|
||||
setShowNode((data.showNode ?? true) ? false : true);
|
||||
return;
|
||||
}
|
||||
setNoticeData({
|
||||
|
|
|
|||
|
|
@ -167,10 +167,10 @@ export default function ProfileSettingsPage(): JSX.Element {
|
|||
<GradientChooserComponent
|
||||
value={
|
||||
gradient == ""
|
||||
? userData?.profile_image ??
|
||||
? (userData?.profile_image ??
|
||||
gradients[
|
||||
parseInt(userData?.id ?? "", 30) % gradients.length
|
||||
]
|
||||
])
|
||||
: gradient
|
||||
}
|
||||
onChange={(value) => {
|
||||
|
|
|
|||
|
|
@ -43,10 +43,10 @@ const ProfileGradientFormComponent = ({
|
|||
<GradientChooserComponent
|
||||
value={
|
||||
gradient == ""
|
||||
? userData?.profile_image ??
|
||||
? (userData?.profile_image ??
|
||||
gradients[
|
||||
parseInt(userData?.id ?? "", 30) % gradients.length
|
||||
]
|
||||
])
|
||||
: gradient
|
||||
}
|
||||
onChange={(value) => {
|
||||
|
|
|
|||
|
|
@ -53,10 +53,10 @@ const ProfilePictureFormComponent = ({
|
|||
loading={isLoading || isFetching}
|
||||
value={
|
||||
profilePicture == ""
|
||||
? userData?.profile_image ??
|
||||
? (userData?.profile_image ??
|
||||
gradients[
|
||||
parseInt(userData?.id ?? "", 30) % gradients.length
|
||||
]
|
||||
])
|
||||
: profilePicture
|
||||
}
|
||||
onChange={(value) => {
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ export default function StorePage(): JSX.Element {
|
|||
setTotalRowsCount(
|
||||
filteredCategories?.length === 0
|
||||
? Number(res?.count ?? 0)
|
||||
: res?.results?.length ?? 0,
|
||||
: (res?.results?.length ?? 0),
|
||||
);
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue