From 9dfccae16527128eeae449936d4ab6a11e1cc00c Mon Sep 17 00:00:00 2001 From: Sara Han <127759186+sdiazlor@users.noreply.github.com> Date: Mon, 10 Jun 2024 11:29:34 +0200 Subject: [PATCH 1/5] docs: add changelog (#4983) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This is the preview. The changelog generation doesn't affect the building time. Maybe it would be better to remove the right toc. ![Captura de pantalla 2024-06-09 125213](https://github.com/argilla-io/argilla/assets/127759186/80158924-6d47-4d3c-a4c2-17b99c357db6) Closes #4972 **Type of change** (Remember to title the PR according to the type of change) - [ ] Documentation update **How Has This Been Tested** ``` mkdocs serve ``` --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- argilla-sdk/docs/scripts/gen_changelog.py | 47 +++++++++++++++++++++++ argilla-sdk/mkdocs.yml | 8 ++-- 2 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 argilla-sdk/docs/scripts/gen_changelog.py diff --git a/argilla-sdk/docs/scripts/gen_changelog.py b/argilla-sdk/docs/scripts/gen_changelog.py new file mode 100644 index 0000000000..14792149bc --- /dev/null +++ b/argilla-sdk/docs/scripts/gen_changelog.py @@ -0,0 +1,47 @@ +# Copyright 2024-present, Argilla, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +import requests +import base64 +import mkdocs_gen_files + + +REPOSITORY = "argilla-io/argilla" +CHANGELOG_PATH = "argilla/CHANGELOG.md" +RETRIEVED_BRANCH = "develop" + +DATA_PATH = "community/changelog.md" + +GITHUB_ACCESS_TOKEN = os.environ["GITHUB_ACCESS_TOKEN"] + + +def fetch_file_from_github(repository, changelog_path, branch, auth_token): + headers = {"Authorization": f"Bearer {auth_token}", "Accept": "application/vnd.github.v3+json"} + + owner, repo_name = repository.split("/") + changelog_url = f"https://api.github.com/repos/{owner}/{repo_name}/contents/{changelog_path}?ref={branch}" + + print(f"Fetching CHANGELOG.md from {changelog_url}...") + response = requests.get(changelog_url, headers=headers) + + content = base64.b64decode(response.json()["content"]).decode("utf-8") + + return content + + +with mkdocs_gen_files.open(DATA_PATH, "w") as f: + content = fetch_file_from_github(REPOSITORY, CHANGELOG_PATH, RETRIEVED_BRANCH, GITHUB_ACCESS_TOKEN) + f.write(content) diff --git a/argilla-sdk/mkdocs.yml b/argilla-sdk/mkdocs.yml index 850decc636..2d88df2c68 100644 --- a/argilla-sdk/mkdocs.yml +++ b/argilla-sdk/mkdocs.yml @@ -101,9 +101,10 @@ markdown_extensions: plugins: - search - open-in-new-tab - # - gen-files: - # scripts: - # - docs/scripts/gen_ref_pages.py + - gen-files: + scripts: + - docs/scripts/gen_changelog.py + # - docs/scripts/gen_ref_pages.py - literate-nav: nav_file: SUMMARY.md - section-index @@ -144,5 +145,6 @@ nav: - Community: - community/index.md - How to contribute?: community/contributor.md + - Changelog: community/changelog.md - UI Demo ↗: - https://demo.argilla.io/sign-in?auth=ZGVtbzoxMjM0NTY3OA== \ No newline at end of file From f4f0937785d551dc902d3bbb0842e3db22340a3e Mon Sep 17 00:00:00 2001 From: Sara Han <127759186+sdiazlor@users.noreply.github.com> Date: Mon, 10 Jun 2024 11:44:04 +0200 Subject: [PATCH 2/5] docs: popular issues file generator (#4971) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Script to automatically retrieve the github issues and generate a doc with the most popular. NOTE: By the moment, I left it commented in mkdocs.yml as I don't know if this will be added for 2.0. So, when merged, it's saved but not run. Using it, the docs building takes around 20 seconds more. TO BE DISCUSSED (below a screenshot): 1. Still not sure about the given names to each table, probably it's better to shorten them. 2. I added it to Community, but if you think this is more suitable in other section, we can discuss it. 3. I ran it locally, but I don't know if any external workflow must be also updated. 4. Any other feedback is welcome! ![screencapture-127-0-0-1-8000-argilla-python-community-popular-issues-2024-06-06-14_32_12](https://github.com/argilla-io/argilla/assets/127759186/660656f9-47b9-4703-8411-ef4f2389d068) Closes #4967 **Type of change** (Remember to title the PR according to the type of change) - [x] Documentation update **How Has This Been Tested** - [x] Run with `mkdocs serve` --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: David Berenstein --- .../docs/scripts/gen_popular_issues.py | 136 ++++++++++++++++++ argilla-sdk/mkdocs.yml | 2 + 2 files changed, 138 insertions(+) create mode 100644 argilla-sdk/docs/scripts/gen_popular_issues.py diff --git a/argilla-sdk/docs/scripts/gen_popular_issues.py b/argilla-sdk/docs/scripts/gen_popular_issues.py new file mode 100644 index 0000000000..469bd6789e --- /dev/null +++ b/argilla-sdk/docs/scripts/gen_popular_issues.py @@ -0,0 +1,136 @@ +# Copyright 2024-present, Argilla, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +from datetime import datetime + +import pandas as pd +import requests +import mkdocs_gen_files + + +REPOSITORY = "argilla-io/argilla" +DATA_PATH = "community/popular_issues.md" + +GITHUB_ACCESS_TOKEN = os.environ["GITHUB_ACCESS_TOKEN"] + + +def fetch_data_from_github(repository, auth_token): + headers = {"Authorization": f"token {auth_token}", "Accept": "application/vnd.github.v3+json"} + issues_data = [] + + print(f"Fetching issues from {repository}...") + with requests.Session() as session: + session.headers.update(headers) + + owner, repo_name = repository.split("/") + issues_url = f"https://api.github.com/repos/{owner}/{repo_name}/issues?state=all" + + while issues_url: + response = session.get(issues_url) + issues = response.json() + + for issue in issues: + issues_data.append( + { + "Issue": f"{issue['number']} - {issue['title']}", + "State": issue["state"], + "Created at": issue["created_at"], + "Closed at": issue.get("closed_at", None), + "Last update": issue["updated_at"], + "Labels": [label["name"] for label in issue["labels"]], + "Milestone": (issue.get("milestone") or {}).get("title"), + "Reactions": issue["reactions"]["total_count"], + "Comments": issue["comments"], + "URL": issue["html_url"], + "Repository": repo_name, + "Author": issue["user"]["login"], + } + ) + + issues_url = response.links.get("next", {}).get("url", None) + + return pd.DataFrame(issues_data) + + +def get_org_members(auth_token): + headers = {"Authorization": f"token {auth_token}", "Accept": "application/vnd.github.v3+json"} + members_list = [] + + members_url = "https://api.github.com/orgs/argilla-io/members" + + while members_url: + response = requests.get(members_url, headers=headers) + members = response.json() + + for member in members: + members_list.append(member["login"]) + + members_list.extend(["pre-commit-ci[bot]"]) + + members_url = response.links.get("next", {}).get("url", None) + + return members_list + + +with mkdocs_gen_files.open(DATA_PATH, "w") as f: + df = fetch_data_from_github(REPOSITORY, GITHUB_ACCESS_TOKEN) + + open_issues = df.loc[df["State"] == "open"] + engagement_df = ( + open_issues[["URL", "Issue", "Repository", "Reactions", "Comments"]] + .sort_values(by=["Reactions", "Comments"], ascending=False) + .head(10) + .reset_index() + ) + + members = get_org_members(GITHUB_ACCESS_TOKEN) + community_issues = df.loc[~df["Author"].isin(members)] + community_issues_df = ( + community_issues[["URL", "Issue", "Repository", "Created at", "Author", "State"]] + .sort_values(by=["Created at"], ascending=False) + .head(10) + .reset_index() + ) + + planned_issues = df.loc[df["Milestone"].notna()] + planned_issues_df = ( + planned_issues[["URL", "Issue", "Repository", "Created at", "Milestone", "State"]] + .sort_values(by=["Milestone"], ascending=False) + .head(10) + .reset_index() + ) + + f.write('=== "Most engaging open issues"\n\n') + f.write(" | Rank | Issue | Reactions | Comments |\n") + f.write(" |------|-------|:---------:|:--------:|\n") + for ix, row in engagement_df.iterrows(): + f.write(f" | {ix+1} | [{row['Issue']}]({row['URL']}) | 👍 {row['Reactions']} | 💬 {row['Comments']} |\n") + + f.write('\n=== "Latest issues open by the community"\n\n') + f.write(" | Rank | Issue | Author |\n") + f.write(" |------|-------|:------:|\n") + for ix, row in community_issues_df.iterrows(): + state = "🟢" if row["State"] == "open" else "🟣" + f.write(f" | {ix+1} | {state} [{row['Issue']}]({row['URL']}) | by **{row['Author']}** |\n") + + f.write('\n=== "Planned issues for upcoming releases"\n\n') + f.write(" | Rank | Issue | Milestone |\n") + f.write(" |------|-------|:------:|\n") + for ix, row in planned_issues_df.iterrows(): + state = "🟢" if row["State"] == "open" else "🟣" + f.write(f" | {ix+1} | {state} [{row['Issue']}]({row['URL']}) | **{row['Milestone']}** |\n") + + today = datetime.today().date() + f.write(f"\nLast update: {today}\n") diff --git a/argilla-sdk/mkdocs.yml b/argilla-sdk/mkdocs.yml index 2d88df2c68..4dccc15382 100644 --- a/argilla-sdk/mkdocs.yml +++ b/argilla-sdk/mkdocs.yml @@ -104,6 +104,7 @@ plugins: - gen-files: scripts: - docs/scripts/gen_changelog.py + - docs/scripts/gen_popular_issues.py # - docs/scripts/gen_ref_pages.py - literate-nav: nav_file: SUMMARY.md @@ -145,6 +146,7 @@ nav: - Community: - community/index.md - How to contribute?: community/contributor.md + - Issue dashboard: community/popular_issues.md - Changelog: community/changelog.md - UI Demo ↗: - https://demo.argilla.io/sign-in?auth=ZGVtbzoxMjM0NTY3OA== \ No newline at end of file From 7eaf29426238be2065fb7a050633ff1b1a90fe86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Pumar?= Date: Mon, 10 Jun 2024 16:54:41 +0200 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=9A=84=20feat/improve=20performance?= =?UTF-8?q?=20metrics=20(#4981)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repositories/AgentRepository.ts | 3 ++- .../v1/infrastructure/repositories/AxiosCache.ts | 12 ++++++++++++ .../repositories/DatasetRepository.ts | 15 +++++++-------- .../repositories/EnvironmentRepository.ts | 8 +++++--- .../repositories/FieldRepository.ts | 4 ++-- .../repositories/MetadataMetricsRepository.ts | 3 ++- .../repositories/MetadataRepository.ts | 4 ++-- .../repositories/MetricsRepository.ts | 4 +++- .../repositories/OAuthRepository.ts | 3 ++- .../repositories/QuestionRepository.ts | 4 ++-- .../repositories/RecordRepository.ts | 1 + .../repositories/VectorRepository.ts | 4 ++-- .../repositories/WorkspaceRepository.ts | 3 ++- 13 files changed, 44 insertions(+), 24 deletions(-) diff --git a/argilla-frontend/v1/infrastructure/repositories/AgentRepository.ts b/argilla-frontend/v1/infrastructure/repositories/AgentRepository.ts index eb6b61ed7b..bba85cd8ac 100644 --- a/argilla-frontend/v1/infrastructure/repositories/AgentRepository.ts +++ b/argilla-frontend/v1/infrastructure/repositories/AgentRepository.ts @@ -1,5 +1,6 @@ import { type NuxtAxiosInstance } from "@nuxtjs/axios"; import { Response } from "../types"; +import { mediumCache } from "./AxiosCache"; interface BackendAgent { question: { @@ -20,7 +21,7 @@ export class AgentRepository { try { const { data } = await this.axios.get>( `/v1/datasets/${datasetId}/records/search/suggestions/options`, - { headers: { "cache-control": "max-age=120" } } + mediumCache() ); return data.items; diff --git a/argilla-frontend/v1/infrastructure/repositories/AxiosCache.ts b/argilla-frontend/v1/infrastructure/repositories/AxiosCache.ts index 7f687c7267..2b52f478e2 100644 --- a/argilla-frontend/v1/infrastructure/repositories/AxiosCache.ts +++ b/argilla-frontend/v1/infrastructure/repositories/AxiosCache.ts @@ -94,3 +94,15 @@ export const loadCache = (axios) => { return response; }); }; + +export const largeCache = () => { + return { + headers: { "cache-control": "max-age=600" }, + }; +}; + +export const mediumCache = () => { + return { + headers: { "cache-control": "max-age=120" }, + }; +}; diff --git a/argilla-frontend/v1/infrastructure/repositories/DatasetRepository.ts b/argilla-frontend/v1/infrastructure/repositories/DatasetRepository.ts index 909f146b67..875935d9f0 100644 --- a/argilla-frontend/v1/infrastructure/repositories/DatasetRepository.ts +++ b/argilla-frontend/v1/infrastructure/repositories/DatasetRepository.ts @@ -4,7 +4,7 @@ import { BackendProgress, BackendUpdateDataset, } from "../types/dataset"; -import { revalidateCache } from "./AxiosCache"; +import { largeCache, revalidateCache } from "./AxiosCache"; import { IDatasetRepository } from "@/v1/domain/services/IDatasetRepository"; import { Dataset } from "~/v1/domain/entities/dataset/Dataset"; import { Progress } from "~/v1/domain/entities/dataset/Progress"; @@ -104,9 +104,7 @@ export class DatasetRepository implements IDatasetRepository { try { const { data } = await this.axios.get( `/v1/datasets/${datasetId}/progress`, - { - headers: { "cache-control": "max-age=600" }, - } + largeCache() ); return new Progress( @@ -125,9 +123,10 @@ export class DatasetRepository implements IDatasetRepository { private async getDatasetById(datasetId: string) { try { - const { data } = await this.axios.get(`/v1/datasets/${datasetId}`, { - headers: { "cache-control": "max-age=600" }, - }); + const { data } = await this.axios.get( + `/v1/datasets/${datasetId}`, + largeCache() + ); return data; } catch (err) { @@ -141,7 +140,7 @@ export class DatasetRepository implements IDatasetRepository { try { const { data: responseWorkspace } = await this.axios.get( `/v1/workspaces/${workspaceId}`, - { headers: { "cache-control": "max-age=600" } } + largeCache() ); const { name } = responseWorkspace || { name: null }; diff --git a/argilla-frontend/v1/infrastructure/repositories/EnvironmentRepository.ts b/argilla-frontend/v1/infrastructure/repositories/EnvironmentRepository.ts index 5a542db346..add94fae0e 100644 --- a/argilla-frontend/v1/infrastructure/repositories/EnvironmentRepository.ts +++ b/argilla-frontend/v1/infrastructure/repositories/EnvironmentRepository.ts @@ -1,5 +1,6 @@ import { type NuxtAxiosInstance } from "@nuxtjs/axios"; import { BackendEnvironment } from "../types/environment"; +import { largeCache } from "./AxiosCache"; import { Environment } from "~/v1/domain/entities/environment/Environment"; import { IEnvironmentRepository } from "~/v1/domain/services/IEnvironmentRepository"; @@ -17,9 +18,10 @@ export class EnvironmentRepository implements IEnvironmentRepository { async getEnvironment(): Promise { try { - const { data } = await this.axios.get("v1/settings", { - headers: { "cache-control": "max-age=600" }, - }); + const { data } = await this.axios.get( + "v1/settings", + largeCache() + ); const { argilla, huggingface } = data; diff --git a/argilla-frontend/v1/infrastructure/repositories/FieldRepository.ts b/argilla-frontend/v1/infrastructure/repositories/FieldRepository.ts index 5886e11ba4..49d1ee234e 100644 --- a/argilla-frontend/v1/infrastructure/repositories/FieldRepository.ts +++ b/argilla-frontend/v1/infrastructure/repositories/FieldRepository.ts @@ -1,6 +1,6 @@ import { type NuxtAxiosInstance } from "@nuxtjs/axios"; import { BackendField, Response } from "../types/"; -import { revalidateCache } from "./AxiosCache"; +import { mediumCache, revalidateCache } from "./AxiosCache"; import { Field } from "~/v1/domain/entities/field/Field"; export const enum FIELD_API_ERRORS { @@ -15,7 +15,7 @@ export class FieldRepository { try { const { data } = await this.axios.get>( `/v1/datasets/${datasetId}/fields`, - { headers: { "cache-control": "max-age=120" } } + mediumCache() ); return data.items; diff --git a/argilla-frontend/v1/infrastructure/repositories/MetadataMetricsRepository.ts b/argilla-frontend/v1/infrastructure/repositories/MetadataMetricsRepository.ts index c52c554c1f..f2b8e767f3 100644 --- a/argilla-frontend/v1/infrastructure/repositories/MetadataMetricsRepository.ts +++ b/argilla-frontend/v1/infrastructure/repositories/MetadataMetricsRepository.ts @@ -1,5 +1,6 @@ import { type NuxtAxiosInstance } from "@nuxtjs/axios"; import { BackendMetadataMetric } from "../types"; +import { mediumCache } from "./AxiosCache"; const RECORD_API_ERRORS = { ERROR_FETCHING_METADATA_METRIC: "ERROR_FETCHING_METADATA_METRIC", @@ -12,7 +13,7 @@ export class MetadataMetricsRepository { try { const { data } = await this.axios.get( `/v1/metadata-properties/${metadataId}/metrics`, - { headers: { "cache-control": "max-age=120" } } + mediumCache() ); return { diff --git a/argilla-frontend/v1/infrastructure/repositories/MetadataRepository.ts b/argilla-frontend/v1/infrastructure/repositories/MetadataRepository.ts index b49ea25bc4..8a796a0216 100644 --- a/argilla-frontend/v1/infrastructure/repositories/MetadataRepository.ts +++ b/argilla-frontend/v1/infrastructure/repositories/MetadataRepository.ts @@ -1,7 +1,7 @@ import { type NuxtAxiosInstance } from "@nuxtjs/axios"; import { BackendMetadata, Response } from "../types"; import { MetadataMetricsRepository } from "./MetadataMetricsRepository"; -import { revalidateCache } from "./AxiosCache"; +import { mediumCache, revalidateCache } from "./AxiosCache"; import { Metadata } from "~/v1/domain/entities/metadata/Metadata"; const METADATA_API_ERRORS = { @@ -32,7 +32,7 @@ export class MetadataRepository { // TODO: Review this endpoint, for admin should be /v1/datasets/${datasetId}/metadata-properties without ME. const { data } = await this.axios.get>( `/v1/me/datasets/${datasetId}/metadata-properties`, - { headers: { "cache-control": "max-age=120" } } + mediumCache() ); return data.items; diff --git a/argilla-frontend/v1/infrastructure/repositories/MetricsRepository.ts b/argilla-frontend/v1/infrastructure/repositories/MetricsRepository.ts index 4ac5018194..7cff90f7f9 100644 --- a/argilla-frontend/v1/infrastructure/repositories/MetricsRepository.ts +++ b/argilla-frontend/v1/infrastructure/repositories/MetricsRepository.ts @@ -1,4 +1,5 @@ import { type NuxtAxiosInstance } from "@nuxtjs/axios"; +import { largeCache } from "./AxiosCache"; import { Metrics } from "~/v1/domain/entities/dataset/Metrics"; interface BackendMetrics { @@ -19,7 +20,8 @@ export class MetricsRepository { async getMetrics(datasetId: string): Promise { try { const { data } = await this.axios.get( - `/v1/me/datasets/${datasetId}/metrics` + `/v1/me/datasets/${datasetId}/metrics`, + largeCache() ); return new Metrics( diff --git a/argilla-frontend/v1/infrastructure/repositories/OAuthRepository.ts b/argilla-frontend/v1/infrastructure/repositories/OAuthRepository.ts index ca62c1641e..dd871cd839 100644 --- a/argilla-frontend/v1/infrastructure/repositories/OAuthRepository.ts +++ b/argilla-frontend/v1/infrastructure/repositories/OAuthRepository.ts @@ -2,6 +2,7 @@ import { type NuxtAxiosInstance } from "@nuxtjs/axios"; import { Auth } from "@nuxtjs/auth-next"; import { Response } from "../types"; import { useRunningEnvironment } from "../services/useRunningEnvironment"; +import { largeCache } from "./AxiosCache"; import { OAuthParams, OAuthProvider, @@ -37,7 +38,7 @@ export class OAuthRepository implements IOAuthRepository { const { data } = await this.axios.get>( url, - { headers: { "cache-control": "max-age=240" } } + largeCache() ); return data.items.map((i) => new OAuthProvider(i.name)); diff --git a/argilla-frontend/v1/infrastructure/repositories/QuestionRepository.ts b/argilla-frontend/v1/infrastructure/repositories/QuestionRepository.ts index d1ac8bada0..48bc5396ba 100644 --- a/argilla-frontend/v1/infrastructure/repositories/QuestionRepository.ts +++ b/argilla-frontend/v1/infrastructure/repositories/QuestionRepository.ts @@ -1,6 +1,6 @@ import { type NuxtAxiosInstance } from "@nuxtjs/axios"; import { Response, BackendQuestion } from "../types"; -import { revalidateCache } from "./AxiosCache"; +import { mediumCache, revalidateCache } from "./AxiosCache"; import { Question } from "~/v1/domain/entities/question/Question"; import { IQuestionRepository } from "~/v1/domain/services/IQuestionRepository"; @@ -16,7 +16,7 @@ export class QuestionRepository implements IQuestionRepository { try { const { data } = await this.axios.get>( `/v1/datasets/${datasetId}/questions`, - { headers: { "cache-control": "max-age=120" } } + mediumCache() ); return data.items; diff --git a/argilla-frontend/v1/infrastructure/repositories/RecordRepository.ts b/argilla-frontend/v1/infrastructure/repositories/RecordRepository.ts index d1d3b71eb1..c82ac57bee 100644 --- a/argilla-frontend/v1/infrastructure/repositories/RecordRepository.ts +++ b/argilla-frontend/v1/infrastructure/repositories/RecordRepository.ts @@ -160,6 +160,7 @@ export class RecordRepository { ); revalidateCache(`/v1/datasets/${record.datasetId}/progress`); + revalidateCache(`/v1/me/datasets/${record.datasetId}/metrics`); return new RecordAnswer( data.id, diff --git a/argilla-frontend/v1/infrastructure/repositories/VectorRepository.ts b/argilla-frontend/v1/infrastructure/repositories/VectorRepository.ts index ffd3190388..c19b187a4a 100644 --- a/argilla-frontend/v1/infrastructure/repositories/VectorRepository.ts +++ b/argilla-frontend/v1/infrastructure/repositories/VectorRepository.ts @@ -1,7 +1,7 @@ import { type NuxtAxiosInstance } from "@nuxtjs/axios"; import { BackendVector } from "../types/vector"; import { Response } from "../types"; -import { revalidateCache } from "./AxiosCache"; +import { mediumCache, revalidateCache } from "./AxiosCache"; import { Vector } from "~/v1/domain/entities/vector/Vector"; const enum VECTOR_API_ERRORS { @@ -16,7 +16,7 @@ export class VectorRepository { try { const { data } = await this.axios.get>( `/v1/datasets/${datasetId}/vectors-settings`, - { headers: { "cache-control": "max-age=120" } } + mediumCache() ); return data.items; diff --git a/argilla-frontend/v1/infrastructure/repositories/WorkspaceRepository.ts b/argilla-frontend/v1/infrastructure/repositories/WorkspaceRepository.ts index 82620da826..e0613601c2 100644 --- a/argilla-frontend/v1/infrastructure/repositories/WorkspaceRepository.ts +++ b/argilla-frontend/v1/infrastructure/repositories/WorkspaceRepository.ts @@ -1,5 +1,6 @@ import { type NuxtAxiosInstance } from "@nuxtjs/axios"; import { Response } from "../types"; +import { mediumCache } from "./AxiosCache"; interface BackendWorkspace { id: string; @@ -16,7 +17,7 @@ export class WorkspaceRepository { try { const { data } = await this.axios.get>( "/v1/me/workspaces", - { headers: { "cache-control": "max-age=120" } } + mediumCache() ); return data.items; From ab2263707c9a4d994515194f23168630f915da5e Mon Sep 17 00:00:00 2001 From: David Berenstein Date: Tue, 11 Jun 2024 13:32:41 +0200 Subject: [PATCH 4/5] Update ACCESS_TOKEN naming and documentation hierarchy guides (#4990) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description GITHUB_ACCESS_TOKEN for issues and changelog retrieval was not added to the GH actions and needed a renaming to GH_ACCESS_TOKEN due to protected naming of GITHUB_*. Closes #4989 **Type of change** - [X] Documentation update **How Has This Been Tested** N.A. **Checklist** - [ ] I added relevant documentation - [ ] I followed the style guidelines of this project - [ ] I did a self-review of my code - [ ] I made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK) (see text above) - [ ] I have added relevant notes to the `CHANGELOG.md` file (See https://keepachangelog.com/) --- .github/workflows/argilla-sdk.docs.yml | 13 ++++++- argilla-sdk/docs/community/contributor.md | 4 +-- argilla-sdk/docs/community/index.md | 2 +- argilla-sdk/docs/getting_started/faq.md | 2 +- .../docs/getting_started/installation.md | 2 +- .../docs/getting_started/quickstart.md | 4 +-- .../{guides => }/how_to_guides/dataset.md | 30 ++++++++-------- .../docs/{guides => }/how_to_guides/index.md | 4 +-- .../how_to_guides/query_export.md | 4 +-- .../docs/{guides => }/how_to_guides/record.md | 34 +++++++++---------- .../docs/{guides => }/how_to_guides/user.md | 2 +- .../{guides => }/how_to_guides/workspace.md | 2 +- argilla-sdk/docs/index.md | 2 +- .../docs/reference/argilla_sdk/client.md | 2 +- .../argilla_sdk/datasets/datasets.md | 2 +- argilla-sdk/docs/scripts/gen_changelog.py | 7 ++-- .../docs/scripts/gen_popular_issues.py | 5 ++- argilla-sdk/mkdocs.yml | 15 ++++---- 18 files changed, 72 insertions(+), 64 deletions(-) rename argilla-sdk/docs/{guides => }/how_to_guides/dataset.md (93%) rename argilla-sdk/docs/{guides => }/how_to_guides/index.md (84%) rename argilla-sdk/docs/{guides => }/how_to_guides/query_export.md (95%) rename argilla-sdk/docs/{guides => }/how_to_guides/record.md (95%) rename argilla-sdk/docs/{guides => }/how_to_guides/user.md (97%) rename argilla-sdk/docs/{guides => }/how_to_guides/workspace.md (96%) diff --git a/.github/workflows/argilla-sdk.docs.yml b/.github/workflows/argilla-sdk.docs.yml index d047762858..27940eb276 100644 --- a/.github/workflows/argilla-sdk.docs.yml +++ b/.github/workflows/argilla-sdk.docs.yml @@ -54,12 +54,21 @@ jobs: git config --global user.name "${{ github.actor }}" git config --global user.email "${{ github.actor }}@users.noreply.github.com" + - name: Print GitHub ref info + run: + echo "${{ github.ref }}" + echo "${{ github.head_ref }}" + - run: pdm run mike deploy dev --push if: github.ref == 'refs/heads/feat/v2.0.0' # if: github.ref == 'refs/heads/develop' + env: + GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} - run: pdm run mike deploy ${{ github.ref_name }} latest --update-aliases --push if: startsWith(github.ref, 'refs/tags/') + env: + GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} - name: Extract branch name shell: bash @@ -67,4 +76,6 @@ jobs: id: extract_branch_name - run: pdm run mike deploy ${{ steps.extract_branch_name.outputs.branch_name }} --push - if: startsWith(github.head_ref, 'docs/') + if: startsWith(github.ref, 'refs/heads/docs') || startsWith(github.head_ref, 'docs/') + env: + GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} \ No newline at end of file diff --git a/argilla-sdk/docs/community/contributor.md b/argilla-sdk/docs/community/contributor.md index 4157896533..4956c2f398 100644 --- a/argilla-sdk/docs/community/contributor.md +++ b/argilla-sdk/docs/community/contributor.md @@ -1,5 +1,5 @@ --- -description: Argilla-python is the reference argilla python server SDK. +description: the Argilla Python SDK is the reference Argilla Python server SDK. hide: - footer --- @@ -13,7 +13,7 @@ Thank you for investing your time in contributing to the project! Any contributi * **Git**: This is a very useful tool to keep track of the changes in your files. Using the command-line interface (CLI), you can make your contributions easily. For that, you need to have it [installed and updated](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) on your computer. * **GitHub**: It is a platform and cloud-based service that uses git and allows developers to collaborate on projects. To contribute to Argilla, you'll need to create an account. Check the [Contributor Workflow with Git and Github](#contributor-workflow-with-git-and-github) for more info. * **Developer Documentation**: To collaborate, you'll need to set up an efficient environment. Check the [developer documentation](../getting_started/installation.md) to know how to do it. - * **Schedule a meeting with our developer advocate**: If you have more questions, do not hesitate to contact to our developer advocate and [schedule a meeting](https://calendly.com/argilla-office-hours/30min). + * **Schedule a meeting with our developer advocate**: If you have more questions, do not hesitate to contact our developer advocate and [schedule a meeting](https://calendly.com/argilla-office-hours/30min). ## First Contact in Slack diff --git a/argilla-sdk/docs/community/index.md b/argilla-sdk/docs/community/index.md index 88e1fd0b8c..d6c5ba11b5 100644 --- a/argilla-sdk/docs/community/index.md +++ b/argilla-sdk/docs/community/index.md @@ -1,5 +1,5 @@ --- -description: Argilla-python is the reference argilla python server SDK. +description: the Argilla Python SDK is the reference Argilla Python server. hide: - toc - footer diff --git a/argilla-sdk/docs/getting_started/faq.md b/argilla-sdk/docs/getting_started/faq.md index ffda3d80e2..410b90ff86 100644 --- a/argilla-sdk/docs/getting_started/faq.md +++ b/argilla-sdk/docs/getting_started/faq.md @@ -1,5 +1,5 @@ --- -description: Argilla-python is the reference argilla python server SDK. +description: the Argilla Python SDK is the reference Argilla Python server. hide: toc --- diff --git a/argilla-sdk/docs/getting_started/installation.md b/argilla-sdk/docs/getting_started/installation.md index b849f11ca2..1c75f064be 100644 --- a/argilla-sdk/docs/getting_started/installation.md +++ b/argilla-sdk/docs/getting_started/installation.md @@ -1,5 +1,5 @@ --- -description: Installation of Argilla-python. +description: Installation of the Argilla Python SDK. --- # Installation diff --git a/argilla-sdk/docs/getting_started/quickstart.md b/argilla-sdk/docs/getting_started/quickstart.md index a7e7270a6f..c373b81bd2 100644 --- a/argilla-sdk/docs/getting_started/quickstart.md +++ b/argilla-sdk/docs/getting_started/quickstart.md @@ -108,12 +108,12 @@ Now you can add the data to your dataset. Use a `mapping` to indicate which keys ```python dataset.records.log(records=data, mapping={"text": "review"}) -``` +``` 🎉 You have successfully created your first dataset with Argilla. You can now access it in the Argilla UI and start annotating the records. ## More references * [Installation guide](installation.md) -* [How-to guides](../guides/how_to_guides/index.md) +* [How-to guides](../how_to_guides/index.md) * [API reference](../reference//argilla_sdk/client.md) diff --git a/argilla-sdk/docs/guides/how_to_guides/dataset.md b/argilla-sdk/docs/how_to_guides/dataset.md similarity index 93% rename from argilla-sdk/docs/guides/how_to_guides/dataset.md rename to argilla-sdk/docs/how_to_guides/dataset.md index c7a10df405..95858040b4 100644 --- a/argilla-sdk/docs/guides/how_to_guides/dataset.md +++ b/argilla-sdk/docs/how_to_guides/dataset.md @@ -25,7 +25,7 @@ A **dataset** is a collection of records that you can configure for labelers to client=client ) ``` - > Check the [Dataset - Python Reference](../../reference/argilla_sdk/datasets/datasets.md) to see the attributes, arguments, and methods of the `Dataset` class in detail. + > Check the [Dataset - Python Reference](../reference/argilla_sdk/datasets/datasets.md) to see the attributes, arguments, and methods of the `Dataset` class in detail. === "`rg.Settings`" @@ -45,7 +45,7 @@ A **dataset** is a collection of records that you can configure for labelers to ) ``` - > Check the [Settings - Python Reference](../../reference/argilla_sdk/settings/settings.md) to see the attributes, arguments, and methods of the `Settings` class in detail. + > Check the [Settings - Python Reference](../reference/argilla_sdk/settings/settings.md) to see the attributes, arguments, and methods of the `Settings` class in detail. ## Create a dataset @@ -148,7 +148,7 @@ rg.TextField( use_markdown=False ) ``` -![TextField](../../assets/images/how_to_guides/dataset/fields.png) +![TextField](../assets/images/how_to_guides/dataset/fields.png) ### Questions @@ -172,7 +172,7 @@ To collect feedback for your dataset, you need to formulate questions that annot labels={"YES": "Yes", "NO": "No"}, # or ["YES", "NO"] ) ``` - ![LabelQuestion](../../assets/images/how_to_guides/dataset/label_question.png) + ![LabelQuestion](../assets/images/how_to_guides/dataset/label_question.png) === "Multi-label" A `MultiLabelQuestion` asks annotators to choose all applicable labels from a list of options. This type is useful for multi-label text classification tasks. In the UI, they will have a squared shape. It has the following configuration: @@ -203,7 +203,7 @@ To collect feedback for your dataset, you need to formulate questions that annot ) ``` - ![MultiLabelQuestion](../../assets/images/how_to_guides/dataset/multilabel_question.png) + ![MultiLabelQuestion](../assets/images/how_to_guides/dataset/multilabel_question.png) === "Ranking" A `RankingQuestion` asks annotators to order a list of options. It is useful to gather information on the preference or relevance of a set of options. Ties are allowed and all options will need to be ranked. It has the following configuration: @@ -228,7 +228,7 @@ To collect feedback for your dataset, you need to formulate questions that annot ) ``` - ![RankingQuestion](../../assets/images/how_to_guides/dataset/ranking_question.png) + ![RankingQuestion](../assets/images/how_to_guides/dataset/ranking_question.png) === "Rating" A `RatingQuestion` asks annotators to select one option from a list of integer values. This type is useful for collecting numerical scores. It has the following configuration: @@ -249,7 +249,7 @@ To collect feedback for your dataset, you need to formulate questions that annot ) ``` - ![RatingQuestion](../../assets/images/how_to_guides/dataset/rating_question.png) + ![RatingQuestion](../assets/images/how_to_guides/dataset/rating_question.png) === "Span" A `SpanQuestion` asks annotators to select a portion of the text of a specific field and apply a label to it. This type of question is useful for named entity recognition or information extraction tasks. It has the following configuration: @@ -281,7 +281,7 @@ To collect feedback for your dataset, you need to formulate questions that annot ) ``` - ![SpanQuestion](../../assets/images/how_to_guides/dataset/span_question.png) + ![SpanQuestion](../assets/images/how_to_guides/dataset/span_question.png) === "Text" A `TextQuestion` offers to annotators a free-text area where they can enter any text. This type is useful for collecting natural language data, such as corrections or explanations. It has the following configuration: @@ -302,7 +302,7 @@ To collect feedback for your dataset, you need to formulate questions that annot ) ``` - ![TextQuestion](../../assets/images/how_to_guides/dataset/text_question.png) + ![TextQuestion](../assets/images/how_to_guides/dataset/text_question.png) ### Metadata @@ -322,7 +322,7 @@ Metadata properties allow you to configure the use of metadata information for t options=["group-a", "group-b", "group-c"] ) ``` - ![TermsMetadataProperty](../../assets/images/how_to_guides/dataset/term_metadata.png) + ![TermsMetadataProperty](../assets/images/how_to_guides/dataset/term_metadata.png) === "Integer" An `IntegerMetadataProperty` allows to add integer values as metadata. It has the following configuration: @@ -340,7 +340,7 @@ Metadata properties allow you to configure the use of metadata information for t max=1984, ) ``` - ![IntegerMetadataProperty](../../assets/images/how_to_guides/dataset/integer_metadata.png) + ![IntegerMetadataProperty](../assets/images/how_to_guides/dataset/integer_metadata.png) === "Float" A `FloatMetadataProperty` allows to add float values as metadata. It has the following configuration: @@ -358,7 +358,7 @@ Metadata properties allow you to configure the use of metadata information for t max=119.6975, ) ``` - ![FloatMetadataProperty](../../assets/images/how_to_guides/dataset/float_metadata.png) + ![FloatMetadataProperty](../assets/images/how_to_guides/dataset/float_metadata.png) ### Vectors @@ -375,7 +375,7 @@ rg.VectorField( dimensions=768 ), ``` -![VectorField](../../assets/images/how_to_guides/dataset/vectors.png) +![VectorField](../assets/images/how_to_guides/dataset/vectors.png) ### Guidelines @@ -385,10 +385,10 @@ Once you have decided on the data to show and the questions to ask, it's importa ```python guidelines = "In this dataset, you will find a collection of records that show a category, an instruction, a context and a response to that instruction. [...]" ``` -![Guidelines](../../assets/images/how_to_guides/dataset/guidelines.png) +![Guidelines](../assets/images/how_to_guides/dataset/guidelines.png) * As question descriptions: these are added as an argument when you create questions in the Python SDK. This text will appear in a tooltip next to the question in the UI. -![Guidelines as descriptions](../../assets/images/how_to_guides/dataset/guidelines_description.png) +![Guidelines as descriptions](../assets/images/how_to_guides/dataset/guidelines_description.png) It is good practice to use at least the dataset guidelines if not both methods. Question descriptions should be short and provide context to a specific question. They can be a summary of the guidelines to that question, but often that is not sufficient to align the whole annotation team. In the guidelines, you can include a description of the project, details on how to answer each question with examples, instructions on when to discard a record, etc. diff --git a/argilla-sdk/docs/guides/how_to_guides/index.md b/argilla-sdk/docs/how_to_guides/index.md similarity index 84% rename from argilla-sdk/docs/guides/how_to_guides/index.md rename to argilla-sdk/docs/how_to_guides/index.md index c8456903af..3687526c53 100644 --- a/argilla-sdk/docs/guides/how_to_guides/index.md +++ b/argilla-sdk/docs/how_to_guides/index.md @@ -1,11 +1,11 @@ --- -description: These are the how-to guides for the Argilla-python SDK. They provide step-by-step instructions for common scenarios, including detailed explanations and code samples. +description: These are the how-to guides for the the Argilla Python SDK SDK. They provide step-by-step instructions for common scenarios, including detailed explanations and code samples. hide: toc --- # How-to guides -These are the how-to guides for the *Argilla-python SDK*. They provide step-by-step instructions for common scenarios, including detailed explanations and code samples. +These are the how-to guides for the *the Argilla Python SDK SDK*. They provide step-by-step instructions for common scenarios, including detailed explanations and code samples.
diff --git a/argilla-sdk/docs/guides/how_to_guides/query_export.md b/argilla-sdk/docs/how_to_guides/query_export.md similarity index 95% rename from argilla-sdk/docs/guides/how_to_guides/query_export.md rename to argilla-sdk/docs/how_to_guides/query_export.md index 8f928e48af..1a18a89436 100644 --- a/argilla-sdk/docs/guides/how_to_guides/query_export.md +++ b/argilla-sdk/docs/how_to_guides/query_export.md @@ -18,7 +18,7 @@ You can search for records in your dataset by **querying** or **filtering**. The filter=filter ) ``` - > Check the [Query - Python Reference](../../reference/argilla_sdk/search.md) to see the attributes, arguments, and methods of the `Query` class in detail. + > Check the [Query - Python Reference](../reference/argilla_sdk/search.md) to see the attributes, arguments, and methods of the `Query` class in detail. === "`rg.Filter`" @@ -29,7 +29,7 @@ You can search for records in your dataset by **querying** or **filtering**. The ] ) ``` - > Check the [Filter - Python Reference](../../reference/argilla_sdk/search.md) to see the attributes, arguments, and methods of the `Filter` class in detail. + > Check the [Filter - Python Reference](../reference/argilla_sdk/search.md) to see the attributes, arguments, and methods of the `Filter` class in detail. ## Query with search terms diff --git a/argilla-sdk/docs/guides/how_to_guides/record.md b/argilla-sdk/docs/how_to_guides/record.md similarity index 95% rename from argilla-sdk/docs/guides/how_to_guides/record.md rename to argilla-sdk/docs/how_to_guides/record.md index f6fe826867..028ac2f4d8 100644 --- a/argilla-sdk/docs/guides/how_to_guides/record.md +++ b/argilla-sdk/docs/how_to_guides/record.md @@ -33,7 +33,7 @@ A **record** in Argilla is a data item that requires annotation, consisting of o ], ) ``` - > Check the [Record - Python Reference](../../reference/argilla_sdk/records/records.md) to see the attributes, arguments, and methods of the `Record` class in detail. + > Check the [Record - Python Reference](../reference/argilla_sdk/records/records.md) to see the attributes, arguments, and methods of the `Record` class in detail. ## Add records @@ -73,18 +73,18 @@ You can add records to a dataset in two different ways: either by using a dictio dataset.records.log(records) ``` - - 1. This is an illustration of a definition. In a real world scenario, you would iterate over a data structure and create `Record` objects for each iteration. + + 1. This is an illustration of a definition. In a real world scenario, you would iterate over a data structure and create `Record` objects for each iteration. === "From a generic data structure" - You can add the data directly as a dictionary like structure, where the keys correspond to the names of fields, questions, metadata or vectors in the dataset and the values are the data to be added. - + You can add the data directly as a dictionary like structure, where the keys correspond to the names of fields, questions, metadata or vectors in the dataset and the values are the data to be added. + If your data structure does not correspond to your Argilla dataset names, you can use a `mapping` to indicate which keys in the source data correspond to the dataset fields. We illustrate this python dictionaries that represent your data, but we would not advise you to to define dictionaries. Instead use the `Record` object for instatiating records. - ```python + ```python import argilla_sdk as rg client = rg.Argilla(api_url="", api_key="") @@ -118,7 +118,7 @@ You can add records to a dataset in two different ways: either by using a dictio dataset.records.log(data, mapping={"query": "question", "response": "answer"}) # (2) ``` - 1. The data structure's keys must match the fields or questions in the Argilla dataset. In this case, there are fields named `question` and `answer`. + 1. The data structure's keys must match the fields or questions in the Argilla dataset. In this case, there are fields named `question` and `answer`. 2. The data structure has keys `query` and `response` and the Argilla dataset has `question` and `answer`. You can use the `mapping` parameter to map the keys in the data structure to the fields in the Argilla dataset. @@ -126,8 +126,8 @@ You can add records to a dataset in two different ways: either by using a dictio You can also add records to a dataset using a Hugging Face dataset. This is useful when you want to use a dataset from the Hugging Face Hub and add it to your Argilla dataset. - You can add the dataset where the column names correspond to the names of fields, questions, metadata or vectors in the Argilla dataset. - + You can add the dataset where the column names correspond to the names of fields, questions, metadata or vectors in the Argilla dataset. + If the dataset's schema does not correspond to your Argilla dataset names, you can use a `mapping` to indicate which columns in the dataset correspond to the Argilla dataset fields. ```python @@ -142,14 +142,14 @@ You can add records to a dataset in two different ways: either by using a dictio hf_dataset = load_dataset("imdb", split="train[:100]") # (2) dataset.records.log(records=hf_dataset) - ``` + ``` 1. In this case, we are using the `my_dataset` dataset from the Argilla workspace. The dataset has a `text` field and a `label` question. 2. In this example, the Hugging Face dataset matches the Argilla dataset schema. If that is not the case, you could use the `.map` of the `datasets` library to prepare the data before adding it to the Argilla dataset. Here we use the `mapping` parameter to specify the relationship between the Hugging Face dataset and the Argilla dataset. - + ```python dataset.records.log(records=hf_dataset, mapping={"txt": "text", "y": "label"}) # (1) ``` @@ -166,7 +166,7 @@ Record metadata can include any information about the record that is not part of === "As `Record` objects" - You can add metadata to a record in an initialized `Record` object. + You can add metadata to a record in an initialized `Record` object. ```python # Add records to the dataset with the metadata 'category' @@ -222,7 +222,7 @@ You can associate vectors, like text embeddings, to your records. They can be us You can also add vectors to a record in an initialized `Record` object. - > Check the [Vector - Python Reference](../../reference/argilla_sdk/records/vectors.md) to see the attributes, arguments, and methods of the `Vector` class in detail. + > Check the [Vector - Python Reference](../reference/argilla_sdk/records/vectors.md) to see the attributes, arguments, and methods of the `Vector` class in detail. ```python # Add records to the dataset with the vector 'my_vector' and dimension=3 @@ -277,7 +277,7 @@ Suggestions refer to suggested responses (e.g. model predictions) that you can a === "As `Record objects" You can also add suggestions to a record in an initialized `Record` object. - > Check the [Suggestions - Python Reference](../../reference/argilla_sdk/records/suggestions.md) to see the attributes, arguments, and methods of the `Suggestion` class in detail. + > Check the [Suggestions - Python Reference](../reference/argilla_sdk/records/suggestions.md) to see the attributes, arguments, and methods of the `Suggestion` class in detail. ```python # Add records to the dataset with the label 'my_label' @@ -348,7 +348,7 @@ If your dataset includes some annotations, you can add those to the records as y === "As `Record` objects" You can also add suggestions to a record in an initialized `Record` object. - > Check the [Responses - Python Reference](../../reference/argilla_sdk/records/responses.md) to see the attributes, arguments, and methods of the `Suggestion` class in detail. + > Check the [Responses - Python Reference](../reference/argilla_sdk/records/responses.md) to see the attributes, arguments, and methods of the `Suggestion` class in detail. ```python # Add records to the dataset with the label 'my_label' @@ -443,12 +443,12 @@ dataset.records.log(records=updated_data) ```python updated_records = [] - + for record in dataset.records(): record.metadata["my_metadata"] = "new_value" record.metadata["my_new_metadata"] = "new_value" - + updated_records.append(record) dataset.records.log(records=updated_records) diff --git a/argilla-sdk/docs/guides/how_to_guides/user.md b/argilla-sdk/docs/how_to_guides/user.md similarity index 97% rename from argilla-sdk/docs/guides/how_to_guides/user.md rename to argilla-sdk/docs/how_to_guides/user.md index 3a28b384f5..bc0cb2ec91 100644 --- a/argilla-sdk/docs/guides/how_to_guides/user.md +++ b/argilla-sdk/docs/how_to_guides/user.md @@ -69,7 +69,7 @@ Argilla provides a default user with the `owner` role to help you get started in client=client ) ``` - > Check the [User - Python Reference](../../reference/argilla_sdk/users.md) to see the attributes, arguments, and methods of the `User` class in detail. + > Check the [User - Python Reference](../reference/argilla_sdk/users.md) to see the attributes, arguments, and methods of the `User` class in detail. ## Get current user diff --git a/argilla-sdk/docs/guides/how_to_guides/workspace.md b/argilla-sdk/docs/how_to_guides/workspace.md similarity index 96% rename from argilla-sdk/docs/guides/how_to_guides/workspace.md rename to argilla-sdk/docs/how_to_guides/workspace.md index d610e5c37d..27756574ce 100644 --- a/argilla-sdk/docs/guides/how_to_guides/workspace.md +++ b/argilla-sdk/docs/how_to_guides/workspace.md @@ -31,7 +31,7 @@ Argilla provides a default workspace to help you get started in Python and the U client=client ) ``` - > Check the [Workspace - Python Reference](../../reference/argilla_sdk/workspaces.md) to see the attributes, arguments, and methods of the `Workspace` class in detail. + > Check the [Workspace - Python Reference](../reference/argilla_sdk/workspaces.md) to see the attributes, arguments, and methods of the `Workspace` class in detail. ## Create a new workspace diff --git a/argilla-sdk/docs/index.md b/argilla-sdk/docs/index.md index 014e368069..d2db8f73b7 100644 --- a/argilla-sdk/docs/index.md +++ b/argilla-sdk/docs/index.md @@ -23,7 +23,7 @@ Argilla is a **collaboration platform for AI engineers and domain experts** that Get familiar with basic and complex workflows for Argilla. From managing `Users`, `Workspaces`. `Datasets` and `Records` to fine-tuning a model. - [:octicons-arrow-right-24: Learn more](guides/how_to_guides/index.md) + [:octicons-arrow-right-24: Learn more](how_to_guides/index.md)
diff --git a/argilla-sdk/docs/reference/argilla_sdk/client.md b/argilla-sdk/docs/reference/argilla_sdk/client.md index 98d0cf89b8..0dc268f8a0 100644 --- a/argilla-sdk/docs/reference/argilla_sdk/client.md +++ b/argilla-sdk/docs/reference/argilla_sdk/client.md @@ -3,7 +3,7 @@ hide: footer --- # `rg.Argilla` -To interact with the Argilla server from python you can use the `Argilla` class. The `Argilla` client is used to create, get, update, and delete all Argilla resources, such as workspaces, users, datasets, and records. +To interact with the Argilla server from Python you can use the `Argilla` class. The `Argilla` client is used to create, get, update, and delete all Argilla resources, such as workspaces, users, datasets, and records. ## Usage Examples diff --git a/argilla-sdk/docs/reference/argilla_sdk/datasets/datasets.md b/argilla-sdk/docs/reference/argilla_sdk/datasets/datasets.md index a344e5ad24..84c430e3c0 100644 --- a/argilla-sdk/docs/reference/argilla_sdk/datasets/datasets.md +++ b/argilla-sdk/docs/reference/argilla_sdk/datasets/datasets.md @@ -26,7 +26,7 @@ dataset = rg.Dataset( dataset.create() ``` -For a detail guide of the dataset creation and publication process, see the [Dataset how to guide](/argilla-python/guides/how_to_guides/dataset). +For a detail guide of the dataset creation and publication process, see the [Dataset how to guide](/argilla-python/how_to_guides/dataset). ### Retrieving an existing Dataset diff --git a/argilla-sdk/docs/scripts/gen_changelog.py b/argilla-sdk/docs/scripts/gen_changelog.py index 14792149bc..5582433898 100644 --- a/argilla-sdk/docs/scripts/gen_changelog.py +++ b/argilla-sdk/docs/scripts/gen_changelog.py @@ -12,12 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +import base64 import os -import requests -import base64 import mkdocs_gen_files - +import requests REPOSITORY = "argilla-io/argilla" CHANGELOG_PATH = "argilla/CHANGELOG.md" @@ -25,7 +24,7 @@ DATA_PATH = "community/changelog.md" -GITHUB_ACCESS_TOKEN = os.environ["GITHUB_ACCESS_TOKEN"] +GITHUB_ACCESS_TOKEN = os.environ["GH_ACCESS_TOKEN"] # public_repo and read:org scopes are required def fetch_file_from_github(repository, changelog_path, branch, auth_token): diff --git a/argilla-sdk/docs/scripts/gen_popular_issues.py b/argilla-sdk/docs/scripts/gen_popular_issues.py index 469bd6789e..fd085a9d9e 100644 --- a/argilla-sdk/docs/scripts/gen_popular_issues.py +++ b/argilla-sdk/docs/scripts/gen_popular_issues.py @@ -15,15 +15,14 @@ import os from datetime import datetime +import mkdocs_gen_files import pandas as pd import requests -import mkdocs_gen_files - REPOSITORY = "argilla-io/argilla" DATA_PATH = "community/popular_issues.md" -GITHUB_ACCESS_TOKEN = os.environ["GITHUB_ACCESS_TOKEN"] +GITHUB_ACCESS_TOKEN = os.environ["GH_ACCESS_TOKEN"] # public_repo and read:org scopes are required def fetch_data_from_github(repository, auth_token): diff --git a/argilla-sdk/mkdocs.yml b/argilla-sdk/mkdocs.yml index 4dccc15382..e9b02682cf 100644 --- a/argilla-sdk/mkdocs.yml +++ b/argilla-sdk/mkdocs.yml @@ -133,14 +133,13 @@ nav: - Quickstart: getting_started/quickstart.md - Installation: getting_started/installation.md - FAQ: getting_started/faq.md - - Guides: - - How-to guides: - - guides/how_to_guides/index.md - - Manage users and credentials: guides/how_to_guides/user.md - - Manage workspaces: guides/how_to_guides/workspace.md - - Manage and create datasets: guides/how_to_guides/dataset.md - - Add, update, and delete records: guides/how_to_guides/record.md - - Query, filter, and export records: guides/how_to_guides/query_export.md + - How-to guides: + - how_to_guides/index.md + - Manage users and credentials: how_to_guides/user.md + - Manage workspaces: how_to_guides/workspace.md + - Manage and create datasets: how_to_guides/dataset.md + - Add, update, and delete records: how_to_guides/record.md + - Query, filter, and export records: how_to_guides/query_export.md - API Reference: - Python SDK: reference/argilla_sdk/ - Community: From 694014bb054a083b86f03fe964369a5ec8f15cb3 Mon Sep 17 00:00:00 2001 From: Leire Date: Wed, 12 Jun 2024 10:22:11 +0200 Subject: [PATCH 5/5] feat: UI - update colors and small screen padding (#4999) --- .../form/rating/RatingMonoSelection.component.vue | 9 ++------- .../label-selection/LabelSelection.component.vue | 2 +- .../components/features/datasets/DatasetsTable.vue | 3 +++ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/argilla-frontend/components/features/annotation/container/questions/form/rating/RatingMonoSelection.component.vue b/argilla-frontend/components/features/annotation/container/questions/form/rating/RatingMonoSelection.component.vue index a723ad36fb..2c091dfc1e 100644 --- a/argilla-frontend/components/features/annotation/container/questions/form/rating/RatingMonoSelection.component.vue +++ b/argilla-frontend/components/features/annotation/container/questions/form/rating/RatingMonoSelection.component.vue @@ -116,11 +116,6 @@ export default { display: inline-flex; gap: $base-space; border-radius: $border-radius-rounded; - border: 1px solid #cdcdff; - background: #e0e0ff; - &:hover { - border-color: darken(palette(purple, 800), 12%); - } } } .label-text { @@ -133,7 +128,7 @@ export default { min-width: $base-space * 4; padding-inline: $base-space; outline: none; - background: palette(purple, 800); + background: palette(grey, 700); color: palette(purple, 200); font-weight: 500; overflow: hidden; @@ -157,7 +152,7 @@ export default { } &:not(.label-active):hover { - background: darken(palette(purple, 800), 5%); + background: darken(palette(grey, 700), 5%); transition: all 0.2s ease-in-out; } } diff --git a/argilla-frontend/components/features/annotation/container/questions/form/shared-components/label-selection/LabelSelection.component.vue b/argilla-frontend/components/features/annotation/container/questions/form/shared-components/label-selection/LabelSelection.component.vue index 0311487d5f..1ccd1d0702 100644 --- a/argilla-frontend/components/features/annotation/container/questions/form/shared-components/label-selection/LabelSelection.component.vue +++ b/argilla-frontend/components/features/annotation/container/questions/form/shared-components/label-selection/LabelSelection.component.vue @@ -351,7 +351,7 @@ export default {