Skip to content

Commit

Permalink
feat: Add support to delete agents
Browse files Browse the repository at this point in the history
  • Loading branch information
Estrada Irribarra, Rodrigo Andres committed Jan 7, 2025
1 parent 3b22b8a commit 919acbb
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Welcome to [**ResumeCraftr**](https://resumecraftr.app), the open-source tool de

---

## Release Notes v0.1.0
## Release Notes v0.2.0

You can find the release notes for version `v0.1.0` [here](https://github.com/raestrada/ResumeCraftr/releases/tag/v0.1.0).
You can find the release notes for version `v0.2.0` [here](https://github.com/raestrada/ResumeCraftr/releases/tag/v0.2.0).

## Step 1: Install ResumeCraftr

Expand All @@ -21,7 +21,7 @@ First, install **ResumeCraftr** using [pipx](https://pypa.github.io/pipx/), a to
To install **ResumeCraftr**, run:

```bash
pipx install git+https://github.com/raestrada/ResumeCraftr.git@v0.1.0
pipx install git+https://github.com/raestrada/ResumeCraftr.git@v0.2.0
```

## Quick Examples
Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ResumeCraftr is an ATS-focused minimalist CV generator that leverages OpenAI and
Ensure you have `pipx` installed, then install ResumeCraftr with:

```bash
pipx install git+https://github.com/raestrada/ResumeCraftr.git@v0.1.0
pipx install git+https://github.com/raestrada/ResumeCraftr.git@v0.2.0
```

Additionally, make sure you have a LaTeX distribution installed, specifically one that includes `xelatex`.
Expand Down
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
<body>
<header>
<div class="release-link">
<a href="https://github.com/raestrada/ResumeCraftr/releases/tag/v0.1.0">Release Notes v0.1.0</a>
<a href="https://github.com/raestrada/ResumeCraftr/releases/tag/v0.2.0">Release Notes v0.2.0</a>
</div>
<nav>
<a href="https://storycraftr.app" class="highlight-link">Check Out StoryCraftr for Novel Writing!</a>
Expand Down Expand Up @@ -202,7 +202,7 @@ <h2>Why ResumeCraftr?</h2>
<h3>Installation</h3>
<div class="install-box">
<p>Install ResumeCraftr using pipx:</p>
<code>pipx install git+https://github.com/raestrada/ResumeCraftr.git@v0.1.0</code>
<code>pipx install git+https://github.com/raestrada/ResumeCraftr.git@v0.2.0</code>
</div>
</section>

Expand Down
Empty file.
55 changes: 55 additions & 0 deletions resumecraftr/cli/utils/json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import json
import os
import re


def merge_json_files(target_file: str, source_file: str, output_path: str) -> None:
"""
Merges two JSON files and writes the merged result into an output file.
- Retains existing values in the target JSON.
- Adds missing keys from the source JSON.
- Saves the merged result to the specified output path.
Args:
target_file (str): Path to the primary JSON file.
source_file (str): Path to the secondary JSON file.
output_path (str): Path where the merged JSON will be saved.
"""

# Load target JSON file (or create an empty dictionary if not found)
if os.path.exists(target_file):
with open(target_file, "r", encoding="utf-8") as f:
target_data = json.load(f)
else:
target_data = {}

# Load source JSON file (or create an empty dictionary if not found)
if os.path.exists(source_file):
with open(source_file, "r", encoding="utf-8") as f:
source_data = json.load(f)
else:
source_data = {}

# Merge source_data into target_data without overwriting existing values
for key, value in source_data.items():
if key not in target_data:
target_data[key] = value

# Save the merged JSON into output_path
with open(output_path, "w", encoding="utf-8") as f:
json.dump(target_data, f, indent=4, ensure_ascii=False)

print(f"Merged JSON successfully saved to: {output_path}")


def clean_json_response(response):
"""
Extrae solo el JSON válido de la respuesta de OpenAI eliminando cualquier texto adicional.
"""
try:
match = re.search(r"(\{.*\}|\[.*\])", response, re.DOTALL)
if match:
return json.loads(match.group(0)) # Convierte el JSON a objeto Python
return None # Retorna None si no encuentra JSON válido
except json.JSONDecodeError:
return None # Retorna None si la conversión a JSON falla

0 comments on commit 919acbb

Please sign in to comment.