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

chore: general code fixes/clean up #1513

Merged
merged 7 commits into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 10 additions & 3 deletions packages/client-github/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,20 @@ export class GitHubClient {
while (retries < maxRetries) {
try {
await this.git.clone(repositoryUrl, this.repoPath);
elizaLogger.log(`Successfully cloned repository from ${repositoryUrl}`);
elizaLogger.log(
`Successfully cloned repository from ${repositoryUrl}`
);
return;
} catch (error) {
elizaLogger.error(`Failed to clone repository from ${repositoryUrl}. Retrying...`);
elizaLogger.error(
`Failed to clone repository from ${repositoryUrl}. Retrying...`,
error
);
retries++;
if (retries === maxRetries) {
throw new Error(`Unable to clone repository from ${repositoryUrl} after ${maxRetries} retries.`);
throw new Error(
`Unable to clone repository from ${repositoryUrl} after ${maxRetries} retries.`
);
}
}
}
Expand Down
11 changes: 2 additions & 9 deletions packages/core/src/embedding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,13 @@ export const EmbeddingProvider = {
BGE: "BGE",
} as const;

export type EmbeddingProvider =
export type EmbeddingProviderType =
(typeof EmbeddingProvider)[keyof typeof EmbeddingProvider];

export namespace EmbeddingProvider {
export type OpenAI = typeof EmbeddingProvider.OpenAI;
export type Ollama = typeof EmbeddingProvider.Ollama;
export type GaiaNet = typeof EmbeddingProvider.GaiaNet;
export type BGE = typeof EmbeddingProvider.BGE;
}

export type EmbeddingConfig = {
readonly dimensions: number;
readonly model: string;
readonly provider: EmbeddingProvider;
readonly provider: EmbeddingProviderType;
};

export const getEmbeddingConfig = (): EmbeddingConfig => ({
Expand Down
23 changes: 8 additions & 15 deletions packages/plugin-starknet/src/actions/unruggable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,21 @@ import {
Memory,
ModelClass,
State,
type Action,
} from "@elizaos/core";
import { Percent } from "@uniswap/sdk-core";
import { createMemecoin, launchOnEkubo } from "unruggable-sdk";
import { constants } from "starknet";

import {
getStarknetAccount,
getStarknetProvider,
parseFormatedAmount,
parseFormatedPercentage,
} from "../utils/index.ts";
import { DeployData, Factory } from "@unruggable_starknet/core";
import { AMM, QUOTE_TOKEN_SYMBOL } from "@unruggable_starknet/core/constants";
import { getStarknetAccount, getStarknetProvider } from "../utils/index.ts";
// import { DeployData, Factory } from "@unruggable_starknet/core";
// import { AMM, QUOTE_TOKEN_SYMBOL } from "@unruggable_starknet/core/constants";
import { ACCOUNTS, TOKENS } from "../utils/constants.ts";
import { validateStarknetConfig } from "../environment.ts";

interface SwapContent {
sellTokenAddress: string;
buyTokenAddress: string;
sellAmount: string;
}
// interface SwapContent {
// sellTokenAddress: string;
// buyTokenAddress: string;
// sellAmount: string;
// }

interface DeployTokenContent {
name: string;
Expand Down
Loading