Skip to content

Commit

Permalink
Sweep: Update the docstrings and comments in sdks/ts/src/utils/isVali…
Browse files Browse the repository at this point in the history
…dUuid4.ts to fix any issues and mismatch between the comment and associated code (#240)

* feat: Updated sdks/ts/src/utils/isValidUuid4.ts

* refactor: Lint agents-api (CI)

---------

Co-authored-by: sweep-ai[bot] <128439645+sweep-ai[bot]@users.noreply.github.com>
Co-authored-by: sweep-ai[bot] <sweep-ai[bot]@users.noreply.github.com>
  • Loading branch information
sweep-ai[bot] and sweep-ai[bot] authored Apr 18, 2024
1 parent 9d23412 commit 53ebb10
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 2 additions & 4 deletions agents-api/agents_api/activities/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ class ChatML(BaseModel):
token_count: Optional[int] = None


class BaseTask(BaseModel):
...
class BaseTask(BaseModel): ...


class BaseTaskArgs(BaseModel):
...
class BaseTaskArgs(BaseModel): ...


class AddPrinciplesTaskArgs(BaseTaskArgs):
Expand Down
6 changes: 2 additions & 4 deletions agents-api/agents_api/clients/worker/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ class ChatML(BaseModel):
token_count: Optional[int] = None


class BaseTask(BaseModel):
...
class BaseTask(BaseModel): ...


class BaseTaskArgs(BaseModel):
...
class BaseTaskArgs(BaseModel): ...


class MemoryManagementTaskArgs(BaseTaskArgs):
Expand Down
6 changes: 5 additions & 1 deletion sdks/ts/src/utils/isValidUuid4.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { validate as uuidValidate, version as uuidVersion } from "uuid";

/**
* Checks if the input string is a valid UUID v4.
* Validates if the input string is a valid UUID v4.
* This function performs a two-step validation process:
* 1. Validates the format of the UUID using `uuidValidate`.
* 2. Checks that the version of the UUID is 4 using `uuidVersion`.
* @param {string} uuidToTest The string to test for a valid UUID v4.
* @returns {boolean} True if the input is a valid UUID v4, otherwise false.
*/
export function isValidUuid4(uuidToTest: string): boolean {
// Validate the UUID format and check its version is 4
return uuidValidate(uuidToTest) && uuidVersion(uuidToTest) === 4;
}

0 comments on commit 53ebb10

Please sign in to comment.