Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new example demonstrating CV (curriculum vitae) parsing using gimkit's structured text generation capabilities. The example shows how to extract structured information from a CV using masked tags and JSON output format with the OpenRouter API.
Key Changes
- Added
examples/cv_parser.pydemonstrating extraction of CV fields including personal info, education history, and academic metrics - Uses JSON output type for structured data extraction
- Demonstrates complex nested structures (educational history list) with gimkit
| client = OpenAI( | ||
| api_key="***", | ||
| base_url="https://openrouter.ai/api/v1", | ||
| ) |
There was a problem hiding this comment.
Hard-coded API keys, even when masked, should be avoided in example code. This sets a bad precedent for users. Consider using environment variables instead:
import os
from openai import OpenAI
client = OpenAI(
api_key=os.getenv("OPENAI_API_KEY"),
base_url="https://openrouter.ai/api/v1",
)This approach is consistent with other examples in the repository (see examples/hello_world.py which uses environment variables).
| ) | ||
| model = from_openai(client, model_name="qwen/qwen3-235b-a22b") | ||
|
|
||
| cv_content = "" |
There was a problem hiding this comment.
The cv_content variable is an empty string, which makes this example non-functional. For a CV parser example to be useful, it should either:
- Include sample CV text content, or
- Show how to load CV content from a file, or
- Include a comment explaining that users should replace this with their own CV content
Consider adding a docstring at the top of the file explaining the example's purpose and how to use it.
| @@ -0,0 +1,71 @@ | |||
| from openai import OpenAI | |||
There was a problem hiding this comment.
This example lacks documentation explaining its purpose and usage. Consider adding:
- A module-level docstring describing what the example does
- Comments explaining the key parts (e.g., the extraction fields structure, the model call)
Other examples in the repository (e.g., examples/gimkit_quickstart.py) include helpful section headers and comments that guide users through the code.
No description provided.