Skip to content

Commit

Permalink
Merge branch 'develop' into test-eliza
Browse files Browse the repository at this point in the history
  • Loading branch information
shakkernerd authored Dec 28, 2024
2 parents b96ffd6 + 7d78fcd commit b7db673
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
3 changes: 2 additions & 1 deletion packages/client-github/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ export class GitHubClient {
`Successfully cloned repository from ${repositoryUrl}`
);
return;
} catch {
} catch (error) {
elizaLogger.error(
`Failed to clone repository from ${repositoryUrl}. Retrying...`,
error
);
retries++;
if (retries === maxRetries) {
Expand Down
13 changes: 3 additions & 10 deletions packages/core/src/embedding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,15 @@ interface EmbeddingOptions {
provider?: string;
}

// Define the providers as a const object
export const EMBEDDING_PROVIDERS = {
export const EmbeddingProvider = {
OpenAI: "OpenAI",
Ollama: "Ollama",
GaiaNet: "GaiaNet",
BGE: "BGE",
} as const;

// Create type from the values
export type EmbeddingProvider = typeof EMBEDDING_PROVIDERS[keyof typeof EMBEDDING_PROVIDERS];

// If you need individual types, use type aliases instead of namespace
export type OpenAIProvider = typeof EMBEDDING_PROVIDERS.OpenAI;
export type OllamaProvider = typeof EMBEDDING_PROVIDERS.Ollama;
export type GaiaNetProvider = typeof EMBEDDING_PROVIDERS.GaiaNet;
export type BGEProvider = typeof EMBEDDING_PROVIDERS.BGE;
export type EmbeddingProviderType =
(typeof EmbeddingProvider)[keyof typeof EmbeddingProvider];

export type EmbeddingConfig = {
readonly dimensions: number;
Expand Down
5 changes: 2 additions & 3 deletions packages/core/src/parsing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ export const booleanFooter = `Respond with only a YES or a NO.`;
* @returns {boolean|null} - Returns `true` for affirmative inputs, `false` for negative inputs, and `null` for unrecognized inputs or null/undefined.
*/
export const parseBooleanFromText = (text: string) => {
// "NULL", "UNDEFINED"
if (!text) return null; // Handle null or undefined input

const affirmative = ["YES", "Y", "TRUE", "T", "1", "ON", "ENABLE"];
const negative = ["NO", "N", "FALSE", "F", "0", "OFF", "DISABLE"];
const affirmative = ["YES", "Y", "TRUE", "T", "1", "ON", "ENABLE"];
const negative = ["NO", "N", "FALSE", "F", "0", "OFF", "DISABLE"];

const normalizedText = text.trim().toUpperCase();

Expand Down

0 comments on commit b7db673

Please sign in to comment.