mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-01-04 07:39:43 -06:00
* feat: initial mkdocs setup * chore: lock * fix: config + start getting docs working * fix: remove lots more redundant :type docs, update config more * feat: split up clients * feat: add pydoclint * fix: rm defaults from docstrings * fix: pydoclint errors * feat: run pydoclint in ci * fix: lint on 3.13 * debug: try explicit config path * fix: ignore venv * feat: index, styling * fix: rm footer * fix: more style tweaks * feat: generated docs * fix: refactor a bit * fix: regen * Revert "fix: regen" This reverts commit 7f66adc77840ad96d0eafe55c8dd467f71eb50fb. * feat: improve prompting * feat: add docs, modify theme config to enable toc for docs * fix: lint * fix: lint * feat: regenerate * feat: bs4 for html parsing * feat: preview correctly * fix: exclude site subdir from all the linters * refactor: break up script into components * feat: remove a bunch more stuff from the html * feat: prettier, enable toc * fix: enable tocs in more places + sort properly * fix: code blocks, ordering * fix: ordering * feat: finish up feature clients * fix: rm unused deps * fix: routing + property tags + sidebar * fix: hatchet client + formatting * fix: allow selecting single set of files * fix: lint * rm: cruft * fix: naming * fix: runs client attrs * fix: rm cruft page * feat: internal linking + top level description * [Python]: Fixing some more issues (#1573) * fix: pass priority through from the task * fix: improve eof handling slightly * chore: version * fix: improve eof handling * fix: send prio from durable * fix: naming * cleanup: use a variable * chore: version * feat: comment explaining page depth thing * chore: bump ver * feat: standalone docs * fix: prompting + heading levels
37 lines
1.6 KiB
Python
37 lines
1.6 KiB
Python
from typing import ParamSpec, TypeVar, cast
|
|
|
|
from openai.types.chat import (
|
|
ChatCompletionMessageParam,
|
|
ChatCompletionSystemMessageParam,
|
|
ChatCompletionUserMessageParam,
|
|
)
|
|
|
|
T = TypeVar("T")
|
|
P = ParamSpec("P")
|
|
R = TypeVar("R")
|
|
|
|
|
|
SYSTEM_PROMPT = """
|
|
You're an SDK documentation expert working on improving the readability of Hatchet's Python SDK documentation. You will be given
|
|
a markdown file, and your task is to fix any broken MDX so it can be used as a page on our Nextra documentation site.
|
|
|
|
In your work, follow these instructions:
|
|
|
|
1. Strip any unnecessary paragraph characters, but do not change any actual code, sentences, or content. You should keep the documentation as close to the original as possible, meaning that you should not generate new content, you should not consolidate existing content, you should not rearrange content, and so on.
|
|
2. Return only the content. You should not enclode the markdown in backticks or any other formatting.
|
|
3. You must ensure that MDX will render any tables correctly. One thing in particular to be on the lookout for is the use of the pipe `|` in type hints in the tables. For example, `int | None` is the Python type `Optional[int]` and should render in a single column with an escaped pipe character.
|
|
4. All code blocks should be formatted as `python`.
|
|
"""
|
|
|
|
|
|
def create_prompt_messages(
|
|
user_prompt_content: str,
|
|
) -> list[ChatCompletionMessageParam]:
|
|
return cast(
|
|
list[ChatCompletionMessageParam],
|
|
[
|
|
ChatCompletionSystemMessageParam(content=SYSTEM_PROMPT, role="system"),
|
|
ChatCompletionUserMessageParam(content=user_prompt_content, role="user"),
|
|
],
|
|
)
|