Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/vchart editor merge spec #174

Merged
merged 11 commits into from
Jan 8, 2025
196 changes: 191 additions & 5 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,7 @@ export function QARag() {
{
spec: spec,
appendSpec: {
leafSpec: dslRes,
parentKeyPath,
aliasKeyPath
spec: dslRes
}
},
true
Expand Down Expand Up @@ -478,28 +476,30 @@ export function QARag() {

<div className="one-content">
<div>KeyPath Recall:</div>
{keyPathResult.map((item, index) => (
<Card key={index} className="qa-card">
<div className="qa-div">
<span className="title">Score:</span>
<span>{item.scores.toFixed(2)}</span>
</div>
<div className="qa-div">
<div className="title">content:</div>
<span>{item.text}</span>
</div>
{ragOption.type === 'qa' && (
<div className="qa-div">
<div className="title">Answer:</div>
<span>{item.answer}</span>
</div>
)}
<div className="qa-div">
<div className="title">key:</div>
<span>{item.key}</span>
</div>
</Card>
))}
{keyPathResult && keyPathResult.length
? keyPathResult.map((item, index) => (
<Card key={index} className="qa-card">
<div className="qa-div">
<span className="title">Score:</span>
<span>{item.scores.toFixed(2)}</span>
</div>
<div className="qa-div">
<div className="title">content:</div>
<span>{item.text}</span>
</div>
{ragOption.type === 'qa' ? (
<div className="qa-div">
<div className="title">Answer:</div>
<span>{JSON.stringify(item.answer)}</span>
</div>
) : null}
<div className="qa-div">
<div className="title">key:</div>
<span>{item.key}</span>
</div>
</Card>
))
: null}
</div>
</div>
</div>
Expand Down
16 changes: 16 additions & 0 deletions packages/vmind/__tests__/unit/utils/set.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { set } from '../../../src/utils/set';

describe('set', () => {
it('should set value correctly', () => {
const spec = { padding: { top: 0, left: 0 } };
set(spec, 'padding', 10);

expect(spec).toEqual({ padding: 10 });
});

it('should handle nested object correctly', () => {
const spec = { label: { a: 1 } };
set(spec, 'label.visible', false);
expect(spec).toEqual({ label: { a: 1, visible: false } });
});
});
Loading
Loading