Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
f640973
build: bump package.json version - v0.0.6
ivopaunov Feb 19, 2025
a848732
Merge pull request #10 from AmbireTech/development
ivopaunov Feb 19, 2025
a8351dd
Update version.sh
ivopaunov Feb 19, 2025
f65688a
build: bump package.json version - v0.0.8
cmihaylov Feb 19, 2025
131c247
Add xAI(Grok) module
cmihaylov Feb 24, 2025
2c329c6
Add test for Grok
cmihaylov Feb 24, 2025
11dad1f
Add more context to Grok input
cmihaylov Feb 24, 2025
885677e
Add structured output for Grok, based on zod schemas
cmihaylov Feb 24, 2025
c5b1c20
Fix Grok tests
cmihaylov Feb 24, 2025
2dcaa22
Merge branch 'development' into feat/llm-xai-grok
cmihaylov Feb 24, 2025
2d4961a
Fix portfolio module issue by using node-fetch
cmihaylov Feb 24, 2025
8c12dde
Update demo app: input option for choosing LLM provider
cmihaylov Feb 24, 2025
dd35a03
Refactor folder structure for LLMs
cmihaylov Feb 25, 2025
02446c0
Move out defined llm output structures to module so they are reusable
cmihaylov Feb 25, 2025
7eeecc0
Update demo app: default llm falllback option to mockedAI
cmihaylov Feb 25, 2025
1f6186d
Mark mockedAI strategies with example stamp
cmihaylov Feb 25, 2025
e3931fe
build: bump package.json version - v0.0.9
cmihaylov Feb 25, 2025
940def1
Add llm zod structures to lib export
cmihaylov Feb 25, 2025
5c09485
build: bump package.json version - v0.0.10
cmihaylov Feb 25, 2025
6990ef5
Change LlmProcessOutput structure to include info about LLM
cmihaylov Apr 2, 2025
855867e
Fix tests
cmihaylov Apr 2, 2025
2cbaaee
Add build files
cmihaylov Apr 2, 2025
209f50a
Merge pull request #12 from AmbireTech/feat/change-llm-lib-output-str…
ivopaunov Apr 2, 2025
9594a2e
build: bump package.json version - v0.0.11
cmihaylov Apr 2, 2025
e6745e3
Improved error handling for Grok lib
cmihaylov Apr 2, 2025
ab60d3f
build: bump package.json version - v0.0.12
cmihaylov Apr 2, 2025
956eaa2
Add error to LLM output
cmihaylov Apr 9, 2025
aec9707
Merge pull request #13 from AmbireTech/feat/add-error-to-llm-output
ivopaunov Apr 9, 2025
1c7f8ec
build: bump package.json version - v0.0.13
cmihaylov Apr 9, 2025
17f1d07
update strategy rick
ivopaunov Apr 17, 2025
4b12b31
Merge pull request #14 from AmbireTech/risk-levels-update
ivopaunov Apr 17, 2025
ae2a1c7
build: bump package.json version - v0.0.14
ivopaunov Apr 17, 2025
7290fce
Update gemini and zod structures for action to be more granular and d…
cmihaylov Apr 23, 2025
4d71607
Update StrategyAction type
cmihaylov Apr 23, 2025
1ed9e5e
Add gemini 2.5 and grok 3 models
cmihaylov Apr 23, 2025
5be586b
Refactor llm strutures to reuse common enums
cmihaylov Apr 23, 2025
528fa49
Merge pull request #15 from AmbireTech/feat/improved-llm-output-struc…
cmihaylov Apr 23, 2025
c6d145d
build: bump package.json version - v0.0.15
cmihaylov Apr 23, 2025
c3f2fba
Fix utils/llm/structures export
cmihaylov Apr 24, 2025
89e6cc0
build: bump package.json version - v0.0.16
cmihaylov Apr 24, 2025
5c76683
Add options override feature to LLM calls
cmihaylov Apr 24, 2025
73df3f1
More precise descrition for action structure
cmihaylov Apr 24, 2025
8f72238
Merge pull request #16 from AmbireTech/feat/llm-options-override
cmihaylov Apr 24, 2025
039f766
build: bump package.json version - v0.0.17
cmihaylov Apr 24, 2025
52cd072
Fix: remove temp code in portofolio module
cmihaylov Apr 24, 2025
c6131ff
build: bump package.json version - v0.0.18
cmihaylov Apr 24, 2025
7456f13
Fix: ActionGoogleSchema required fields
cmihaylov Apr 24, 2025
b85d8e7
build: bump package.json version - v0.0.19
cmihaylov Apr 24, 2025
bcb3ce6
Add platform url to LLM output
cmihaylov Apr 25, 2025
e0afbb1
Merge pull request #17 from AmbireTech/feat/add-platform-url-to-output
ivopaunov Apr 25, 2025
303df01
build: bump package.json version - v0.0.20
cmihaylov Apr 25, 2025
974ac24
LLM output: add input and output token count
cmihaylov May 2, 2025
29556b4
Merge pull request #18 from AmbireTech/feat/add-token-count-to-llm-ouput
cmihaylov May 2, 2025
66f3872
build: bump package.json version - v0.0.21
cmihaylov May 2, 2025
11bb199
Add max timeout for LLM responses
cmihaylov May 12, 2025
766d4d1
Merge pull request #19 from AmbireTech/feat/llm-max-timeout
cmihaylov May 12, 2025
c48e59e
build: bump package.json version - v0.0.22
cmihaylov May 12, 2025
a76534d
Update ambire-common
cmihaylov May 27, 2025
42b7d78
Fix: types and portfolio lib logic related to network structure
cmihaylov May 27, 2025
da0063d
Fix: tests
cmihaylov May 27, 2025
ae8d6e7
Merge pull request #20 from AmbireTech/update-ambire-common-and-portf…
cmihaylov May 27, 2025
7044c9a
build: bump package.json version - v0.0.23
cmihaylov May 27, 2025
69c2797
Add: portfolio option for custom fetch function
cmihaylov Jun 3, 2025
ec74c4f
Merge pull request #21 from AmbireTech/feat/portfolio-custom-fetch
cmihaylov Jun 3, 2025
d48011b
build: bump package.json version - v0.0.24
cmihaylov Jun 3, 2025
5ba4a39
Changed: portfolio model, add PortfolioNetworkInfo
cmihaylov Jul 15, 2025
4843e73
Fixed: portfolio tests
cmihaylov Jul 15, 2025
11d7623
Merge pull request #22 from AmbireTech/feat/change-portfolio-model-ne…
cmihaylov Jul 15, 2025
1b25161
build: bump package.json version - v0.1.0
cmihaylov Jul 15, 2025
2fb6ef4
Added: flags to action structure
cmihaylov Aug 7, 2025
548f42b
Add: flags to StrategyAction type
cmihaylov Aug 7, 2025
3b04d0d
Merge pull request #23 from AmbireTech/feat/add-flags-to-action-struc…
cmihaylov Aug 7, 2025
a2caa4c
build: bump package.json version - v0.1.1
cmihaylov Aug 7, 2025
10e2dd1
Changed: update github runner actions/checkout to v5
cmihaylov Sep 17, 2025
e24a0a0
Merge pull request #25 from AmbireTech/build/update-checkout-actin-to-v5
cmihaylov Sep 17, 2025
037d212
add: portfolio token decimals
cmihaylov Nov 25, 2025
41afeeb
Merge pull request #28 from AmbireTech/feat/portfolio-token-decimals
cmihaylov Nov 25, 2025
fd12e68
build: bump package.json version - v0.1.2
cmihaylov Nov 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
NODE_ENV=development
GOOGLE_GEMINI_API_KEY=
GOOGLE_GEMINI_API_KEY=
X_AI_API_KEY=
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Install Node.js
uses: actions/setup-node@v4
Expand Down
14 changes: 11 additions & 3 deletions app/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import express from 'express'
import { processAddress, getPortfolioVelcroV3 } from '../lib/utils/portfolio'
import { callGemini } from '../lib/utils/geminiAI'
import { callGemini } from '../lib/utils/llm/gemini'
import { simplePrompt } from '../lib/utils/prompts'
import { LlmProcessOutput, LlmProcessProps, callGrok, llmMockProcess } from '../lib'

const port = 3420

Expand All @@ -10,12 +11,19 @@ const app = express()
app.use(express.json())

app.post('/', async (req, res) => {
const { address } = req.body
const { address, llm } = req.body

const llmChoices: { [choice: string]: (props: LlmProcessProps) => Promise<LlmProcessOutput> } =
{
gemini: callGemini,
grok: callGrok
}

const data = await processAddress({
address,
getPortfolio: getPortfolioVelcroV3,
makePrompt: simplePrompt,
llmProcessor: callGemini
llmProcessor: llmChoices[llm] || llmMockProcess
})
res.send(data)
})
Expand Down
9 changes: 7 additions & 2 deletions dist/lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
export * from './types';
export * from './utils/portfolio';
export * from './utils/mockedAI';
export * from './utils/geminiAI';
export * from './utils/llm/mockedAI';
export * from './utils/llm/gemini';
export * from './utils/llm/grok';
export * from './utils/llm/structures';
export * from './utils/prompts';
export * from './utils/strategies';
export * from './utils/errors';
export * from './utils/timing';
//# sourceMappingURL=index.d.ts.map
2 changes: 1 addition & 1 deletion dist/lib/index.d.ts.map

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

9 changes: 7 additions & 2 deletions dist/lib/index.js

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

2 changes: 1 addition & 1 deletion dist/lib/index.js.map

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

51 changes: 44 additions & 7 deletions dist/lib/types/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,43 @@
import { TokenResult } from 'ambire-common/dist/src/libs/portfolio/interfaces';
export type PortfolioLibToken = Pick<TokenResult, 'symbol' | 'address' | 'chainId' | 'decimals' | 'amount' | 'priceIn'>;
export type NetworkPortfolioLibResponse = {
tokens: PortfolioLibToken[];
};
export type PortfolioToken = {
address: string;
balance: number;
balanceUSD: number;
symbol: string;
network: string;
decimals: number;
};
export type PortfolioNetworkInfo = {
name: string;
chainId: string;
platformId: string;
explorerUrl: string;
iconUrls: string[];
};
export type PortfolioForNetwork = {
network: string;
network: PortfolioNetworkInfo;
tokens: PortfolioToken[];
};
export declare enum StrategyRisk {
LOW = "low",
MEDIUM = "medium",
HIGH = "high"
MODERATE = "moderate",
HIGH = "high",
OPPORTUNISTIC = "opportunistic"
}
export type StrategyAction = {
tokens: string;
description: string;
platforms?: Array<{
name: string;
url: string;
}>;
networks?: string[];
operations?: string[];
apy?: string;
flags?: string[];
};
export type Strategy = {
name: string;
Expand All @@ -26,20 +47,36 @@ export type Strategy = {
export type LlmProcessProps = {
prompt: string;
model?: string;
llmOptionsOverride?: {
[x: string]: any;
};
timeout?: number;
timeoutMsg?: string;
};
export type LlmProcessOutput = {
llm: {
provider: string;
model: string;
};
response: Strategy[] | null;
inputTokens: number;
outputTokens: number;
error?: string | null;
};
export type LlmProcessOutput = Strategy[] | null;
export type ProcessAddressProps = {
address: string;
getPortfolio: (address: string) => Promise<PortfolioForNetwork[]>;
makePrompt: (props: PromptProps) => Promise<string>;
llmProcessor: (props: LlmProcessProps) => Promise<Strategy[] | null>;
llmProcessor: (props: LlmProcessProps) => Promise<LlmProcessOutput>;
model?: string;
llmOptionsOverride?: any;
};
export type PromptProps = {
portfolio: PortfolioForNetwork[];
};
export type AuraResponse_01 = {
address: string;
portfolio: PortfolioForNetwork[];
strategies: LlmProcessOutput;
strategies: LlmProcessOutput[];
};
//# sourceMappingURL=types.d.ts.map
2 changes: 1 addition & 1 deletion dist/lib/types/types.d.ts.map

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

3 changes: 2 additions & 1 deletion dist/lib/types/types.js

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

2 changes: 1 addition & 1 deletion dist/lib/types/types.js.map

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

2 changes: 2 additions & 0 deletions dist/lib/utils/errors.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export declare function stringifyError(error: unknown): string;
//# sourceMappingURL=errors.d.ts.map
1 change: 1 addition & 0 deletions dist/lib/utils/errors.d.ts.map

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

7 changes: 7 additions & 0 deletions dist/lib/utils/errors.js

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

1 change: 1 addition & 0 deletions dist/lib/utils/errors.js.map

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

7 changes: 7 additions & 0 deletions dist/lib/utils/llm/gemini.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { LlmProcessOutput, LlmProcessProps } from '../../types';
export declare const GEMINI_MODELS: {
gemini20flashExp: string;
gemini25proPreview: string;
};
export declare function callGemini(llmInput: LlmProcessProps): Promise<LlmProcessOutput>;
//# sourceMappingURL=gemini.d.ts.map
1 change: 1 addition & 0 deletions dist/lib/utils/llm/gemini.d.ts.map

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

57 changes: 57 additions & 0 deletions dist/lib/utils/llm/gemini.js

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

Loading