Skip to content

Commit

Permalink
Merge pull request elizaOS#1513 from elizaOS/fixes
Browse files Browse the repository at this point in the history
chore: general code fixes/clean up
  • Loading branch information
shakkernerd authored Dec 28, 2024
2 parents 4dc386d + a0f3134 commit 68a8bb3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 27 deletions.
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

0 comments on commit 68a8bb3

Please sign in to comment.