pop-python 1.0.3__py3-none-any.whl → 1.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- POP/Embedder.py +121 -119
- POP/__init__.py +34 -16
- POP/api_registry.py +148 -0
- POP/context.py +47 -0
- POP/env_api_keys.py +33 -0
- POP/models.py +20 -0
- POP/prompt_function.py +378 -0
- POP/prompts/__init__.py +8 -0
- POP/prompts/openai-json_schema_generator.md +12 -161
- POP/providers/__init__.py +33 -0
- POP/providers/deepseek_client.py +69 -0
- POP/providers/doubao_client.py +101 -0
- POP/providers/gemini_client.py +119 -0
- POP/providers/llm_client.py +60 -0
- POP/providers/local_client.py +45 -0
- POP/providers/ollama_client.py +129 -0
- POP/providers/openai_client.py +100 -0
- POP/stream.py +77 -0
- POP/utils/__init__.py +9 -0
- POP/utils/event_stream.py +43 -0
- POP/utils/http_proxy.py +16 -0
- POP/utils/json_parse.py +21 -0
- POP/utils/oauth/__init__.py +31 -0
- POP/utils/overflow.py +33 -0
- POP/utils/sanitize_unicode.py +18 -0
- POP/utils/validation.py +23 -0
- POP/utils/web_snapshot.py +108 -0
- {pop_python-1.0.3.dist-info → pop_python-1.1.0.dist-info}/METADATA +160 -57
- pop_python-1.1.0.dist-info/RECORD +42 -0
- {pop_python-1.0.3.dist-info → pop_python-1.1.0.dist-info}/WHEEL +1 -1
- pop_python-1.1.0.dist-info/top_level.txt +2 -0
- tests/__init__.py +0 -0
- tests/conftest.py +47 -0
- tests/test_api_registry.py +36 -0
- tests/test_context_utils.py +54 -0
- tests/test_embedder.py +64 -0
- tests/test_env_api_keys.py +15 -0
- tests/test_prompt_function.py +98 -0
- tests/test_web_snapshot.py +47 -0
- POP/LLMClient.py +0 -403
- POP/POP.py +0 -392
- POP/prompts/2024-11-19-content_finder.md +0 -46
- POP/prompts/2024-11-19-get_content.md +0 -71
- POP/prompts/2024-11-19-get_title_and_url.md +0 -62
- POP/prompts/CLI_AI_helper.md +0 -75
- POP/prompts/content_finder.md +0 -42
- POP/prompts/corpus_splitter.md +0 -28
- POP/prompts/function_code_generator.md +0 -51
- POP/prompts/function_description_generator.md +0 -45
- POP/prompts/get_content.md +0 -75
- POP/prompts/get_title_and_url.md +0 -62
- POP/prompts/openai-function_description_generator.md +0 -126
- POP/prompts/openai-prompt_generator.md +0 -49
- POP/schemas/biomedical_ner_extractor.json +0 -37
- POP/schemas/entity_extraction_per_sentence.json +0 -92
- pop_python-1.0.3.dist-info/RECORD +0 -26
- pop_python-1.0.3.dist-info/top_level.txt +0 -1
- {pop_python-1.0.3.dist-info → pop_python-1.1.0.dist-info}/licenses/LICENSE +0 -0
POP/prompts/content_finder.md
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
```markdown
|
|
2
|
-
Given a webpage URL, your task is to analyze its content and identify categories relevant to the specified topic. Follow these instructions carefully:
|
|
3
|
-
|
|
4
|
-
1. **Extract Categories**:
|
|
5
|
-
- Examine the webpage to identify categories relevant to the topic provided.
|
|
6
|
-
|
|
7
|
-
2. **Criteria for Selection**:
|
|
8
|
-
- Categories should be broad enough to cover multiple subtopics but specific enough to offer a clear theme or genre.
|
|
9
|
-
- Ensure the categories are present on the website with accessible URLs.
|
|
10
|
-
- Each category should lead to a page that elaborates on the subject matter.
|
|
11
|
-
|
|
12
|
-
3. **Handling Unsuitable Content**:
|
|
13
|
-
- If the webpage does not align with the specified topic or contains minimal relevant content, classify it as unsuitable.
|
|
14
|
-
- For webpages with no suitable content, use the response format: `{"error": "Refused: No suitable content found."}`
|
|
15
|
-
|
|
16
|
-
4. **Error Handling**:
|
|
17
|
-
- If the webpage URL is invalid or the content is inaccessible, provide an appropriate error message in the response.
|
|
18
|
-
- Do not fabricate URLs; they must be present on the webpage.
|
|
19
|
-
|
|
20
|
-
5. **Output Format**:
|
|
21
|
-
- Present your findings in a JSON object format.
|
|
22
|
-
- Use the key `categories` followed by a list of identified categories relevant to the topic.
|
|
23
|
-
- Ensure the output is clean, with categories listed clearly and concisely.
|
|
24
|
-
|
|
25
|
-
**Example Output for a Suitable Webpage**:
|
|
26
|
-
|
|
27
|
-
```json
|
|
28
|
-
{
|
|
29
|
-
"categories": {"Technology": "url to page", "Health": "url to page", "Education": "url to page"}
|
|
30
|
-
}
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
**Example Output for an Unsuitable Webpage**:
|
|
34
|
-
|
|
35
|
-
```json
|
|
36
|
-
{
|
|
37
|
-
"error": "Refused: No suitable content found."
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Focus on identifying themes that are relevant and engaging for the specified topic, ensuring comprehensive and informative content.
|
|
42
|
-
```
|
POP/prompts/corpus_splitter.md
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
## Task: Extract Story Titles from a Large Corpus of Text Stories
|
|
2
|
-
|
|
3
|
-
You are provided with a segment of text that may contain one or more story titles. Your task is to identify and extract the title of each story present in the text.
|
|
4
|
-
|
|
5
|
-
### Guidelines:
|
|
6
|
-
|
|
7
|
-
1. **Identify Story Titles**: Look for clear indicators of story titles such as distinct headings, chapter titles, or any other formatting markers that signify the beginning of a new story.
|
|
8
|
-
2. **Single or Multiple Titles**: If the text contains a single story or if the title is missing because the story is truncated, return an empty list. If there are multiple story titles, extract each one.
|
|
9
|
-
3. **Preserve Original Formatting**: Extract each title exactly as it appears in the text. Do not modify punctuation, capitalization, or spacing.
|
|
10
|
-
4. **No Additional Text**: Return only the story titles without any surrounding text or commentary.
|
|
11
|
-
5. **Handle Edge Cases**: If no clear story title is found in the text, return an empty list.
|
|
12
|
-
6. If there seems to be no title, just return nothing.
|
|
13
|
-
7. The chapters are NOT titles, do not include them as they can appear more than once.
|
|
14
|
-
|
|
15
|
-
### Return Format:
|
|
16
|
-
|
|
17
|
-
Return a JSON object with one property "titles", which is an array of strings. For example, if the text chunk includes the titles "The Selfish Giant" and "The Devoted Friend", then your output should be:
|
|
18
|
-
|
|
19
|
-
{
|
|
20
|
-
"titles": ["The Selfish Giant", "The Devoted Friend"]
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
Remember:
|
|
24
|
-
- Do not include any markdown formatting, code blocks, or the "```" characters in your answer.
|
|
25
|
-
- All property names must be enclosed in double quotes.
|
|
26
|
-
- Your answer should be nothing but a JSON string that strictly follows the format described above.
|
|
27
|
-
|
|
28
|
-
Please process the text accordingly and return the result.
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# FUNCTION GENERATION PROMPT
|
|
2
|
-
|
|
3
|
-
## Role
|
|
4
|
-
You are a professional Python code generator specializing in creating Python functions from structured descriptions.
|
|
5
|
-
|
|
6
|
-
## Task Description
|
|
7
|
-
You will receive a function description in JSON format with the keys:
|
|
8
|
-
- **`name`**: Specifies the name of the function.
|
|
9
|
-
- **`parameters`**: A dictionary containing parameter names and their types.
|
|
10
|
-
- **`purpose`**: A natural language description detailing what the function should accomplish.
|
|
11
|
-
|
|
12
|
-
Your task is to:
|
|
13
|
-
|
|
14
|
-
1. **Generate a Complete Python Function Signature**:
|
|
15
|
-
- Construct the function signature using type hints.
|
|
16
|
-
|
|
17
|
-
2. **Include a Detailed Docstring**:
|
|
18
|
-
- Clearly document the purpose of the function.
|
|
19
|
-
- Provide comprehensive details on the parameters.
|
|
20
|
-
|
|
21
|
-
3. **Implement the Function**:
|
|
22
|
-
- Develop the function according to the description, ensuring the code is valid and executable.
|
|
23
|
-
- For complex logic beyond your immediate capability, include a `TODO` block for future implementation.
|
|
24
|
-
|
|
25
|
-
4. **Output Format**:
|
|
26
|
-
- Return the generated Python code as a string.
|
|
27
|
-
- Do not include any markdown or additional text unless explicitly requested.
|
|
28
|
-
|
|
29
|
-
### Example Input
|
|
30
|
-
{
|
|
31
|
-
"name": "calculate_area",
|
|
32
|
-
"parameters": {"width": "float", "height": "float"},
|
|
33
|
-
"purpose": "Calculate the area of a rectangle."
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
### Handling Vague or Complex Descriptions
|
|
38
|
-
If the function purpose is too vague, overly complex, or not feasible to reliably generate in Python, respond with:
|
|
39
|
-
{
|
|
40
|
-
"status": "failed",
|
|
41
|
-
"reason": "<concise explanation>"
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
### User Description
|
|
46
|
-
|
|
47
|
-
<<<user_description>>>
|
|
48
|
-
|
|
49
|
-
## Additional Guidelines
|
|
50
|
-
- Maintain clarity and precision in your outputs.
|
|
51
|
-
- Avoid using any '< < <' or '> > >' (without space) outside the original placeholders.
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# FUNCTION DESCRIPTION GENERATOR
|
|
2
|
-
|
|
3
|
-
You are a professional Python design assistant.
|
|
4
|
-
|
|
5
|
-
Given a natural-language request describing a function, you must generate a JSON description with the following fields:
|
|
6
|
-
- `name` (str): the name of the function
|
|
7
|
-
- `parameters` (dict): a dictionary of parameter names and their types
|
|
8
|
-
- `purpose` (str): a clear, human-readable description of what the function does
|
|
9
|
-
|
|
10
|
-
If the user’s request is **too vague** or **impossible to interpret reliably**, respond instead with:
|
|
11
|
-
|
|
12
|
-
{
|
|
13
|
-
"status": "failed",
|
|
14
|
-
"reason": "<short explanation>"
|
|
15
|
-
}
|
|
16
|
-
### Example Input
|
|
17
|
-
|
|
18
|
-
I want a function that does something with data.
|
|
19
|
-
|
|
20
|
-
### Example Output
|
|
21
|
-
|
|
22
|
-
{
|
|
23
|
-
"status": "failed",
|
|
24
|
-
"reason": "The purpose and parameters of the function are unclear from the description."
|
|
25
|
-
}
|
|
26
|
-
### Input
|
|
27
|
-
|
|
28
|
-
I want a function to calculate the area of a triangle from base and height.
|
|
29
|
-
|
|
30
|
-
### Example Output
|
|
31
|
-
|
|
32
|
-
{
|
|
33
|
-
"name": "calculate_triangle_area",
|
|
34
|
-
"parameters": {
|
|
35
|
-
"base": "float",
|
|
36
|
-
"height": "float"
|
|
37
|
-
},
|
|
38
|
-
"purpose": "Calculate the area of a triangle from its base and height."
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
When responding, return only the JSON block with no explanation. Do not include any markdown or additional text, DON'T wrap your return in '`'s.
|
|
42
|
-
|
|
43
|
-
### User Description
|
|
44
|
-
|
|
45
|
-
<<<user_description>>>
|
POP/prompts/get_content.md
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
```markdown
|
|
2
|
-
### Generalized AI Prompt for Content Extraction from Webpage Snapshots
|
|
3
|
-
|
|
4
|
-
**System Instructions:**
|
|
5
|
-
You are a sophisticated assistant tasked with extracting essential content from webpage snapshots focused on a specific topic. Your input will be a textual snapshot of a webpage. Your goal is to meticulously identify and return the main content in a structured, clean format, while systematically ignoring extraneous sections such as advertisements, navigation links, or user comments. Specifically, you are to extract the title, author (when available), and the main body of the content adhering to the structure provided below. Should any required field be absent, retain the structure but leave the field blank.
|
|
6
|
-
|
|
7
|
-
**Desired Output Structure:**
|
|
8
|
-
```json
|
|
9
|
-
{
|
|
10
|
-
"title": "[Identify and insert the content's title here, if discernible.]",
|
|
11
|
-
"author": "[Insert the author's name here, if specified.]",
|
|
12
|
-
"content": "[Extract and format the main text here, ensuring it is presented in clear paragraphs.]",
|
|
13
|
-
"next_page": "[If applicable, include a link or indicator for the next page of content. Otherwise, leave blank.]"
|
|
14
|
-
}
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
### Detailed Guidelines:
|
|
18
|
-
1. **Title Extraction:**
|
|
19
|
-
Identify and extract the most prominent heading (typically marked as `<h1>` in HTML) as the title.
|
|
20
|
-
|
|
21
|
-
2. **Author Identification:**
|
|
22
|
-
Search for explicit mentions of the author's name, often indicated by "By [Author Name]" or contained within metadata elements.
|
|
23
|
-
|
|
24
|
-
3. **Main Content Extraction:**
|
|
25
|
-
Focus on extracting the primary coherent text block, excluding standard sections like headers, footers, or "related articles" links.
|
|
26
|
-
|
|
27
|
-
4. **Precision in Parsing:**
|
|
28
|
-
Apply robust parsing techniques to ensure the exclusion of irrelevant content (e.g., ads, comments) from the `content` field, maintaining focus on the main topic.
|
|
29
|
-
|
|
30
|
-
5. **Next Page Detection:**
|
|
31
|
-
If the content is split across multiple pages, identify any indicators for continuation and store it in the `next_page` field. Leave it blank if not applicable.
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
**Enhanced System Instructions for AI Processing:**
|
|
36
|
-
Upon receiving a webpage snapshot, your objectives are:
|
|
37
|
-
1. Accurately identify and extract the title of the content, if it is explicitly mentioned.
|
|
38
|
-
2. Locate and extract the author's name if it is clearly stated.
|
|
39
|
-
3. Diligently extract the main content, ensuring it is devoid of unrelated elements such as advertisements or user comments.
|
|
40
|
-
4. Determine if the content continues on another page and document this in the `next_page` field if applicable.
|
|
41
|
-
|
|
42
|
-
Format your findings into a JSON object as follows:
|
|
43
|
-
```json
|
|
44
|
-
{
|
|
45
|
-
"title": "[Identify and insert the content's title here, if discernible.]",
|
|
46
|
-
"author": "[Insert the author's name here, if specified.]",
|
|
47
|
-
"content": "[Extract and format the main text here, ensuring it is presented in clear paragraphs.]",
|
|
48
|
-
"next_page": "[If applicable, provide the next page link or indicator here. Otherwise, leave blank.]"
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Ensure accuracy by omitting fields that lack clear data. Refrain from inferring content based on ambiguous or unrelated information.
|
|
53
|
-
|
|
54
|
-
**Example User Input:**
|
|
55
|
-
```
|
|
56
|
-
Title: The Evolution of Artificial Intelligence
|
|
57
|
-
By: Jane Doe
|
|
58
|
-
|
|
59
|
-
Artificial Intelligence (AI) has come a long way since its inception. From simple algorithms to complex neural networks, AI continues to evolve and impact our daily lives...
|
|
60
|
-
|
|
61
|
-
Related Articles:
|
|
62
|
-
- The Future of AI
|
|
63
|
-
- Machine Learning Basics
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
**Expected Refined Output:**
|
|
67
|
-
```json
|
|
68
|
-
{
|
|
69
|
-
"title": "The Evolution of Artificial Intelligence",
|
|
70
|
-
"author": "Jane Doe",
|
|
71
|
-
"content": "Artificial Intelligence (AI) has come a long way since its inception. From simple algorithms to complex neural networks, AI continues to evolve and impact our daily lives...",
|
|
72
|
-
"next_page": ""
|
|
73
|
-
}
|
|
74
|
-
```
|
|
75
|
-
```
|
POP/prompts/get_title_and_url.md
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
```markdown
|
|
2
|
-
# Extracting Information and URLs from Webpage Text
|
|
3
|
-
|
|
4
|
-
## Goal
|
|
5
|
-
To accurately extract and organize relevant information from a given text version of a webpage, focusing on specific topic-related titles and their corresponding URLs, as well as the URL for the next page if available.
|
|
6
|
-
|
|
7
|
-
## Input Details
|
|
8
|
-
- **Source Material**: A text representation of a webpage containing:
|
|
9
|
-
- Titles of content related to a specified topic.
|
|
10
|
-
- The original URLs for these contents.
|
|
11
|
-
- URLs to additional pages (e.g., "page 1", "page 2", or "next page"), if present.
|
|
12
|
-
- **Target Information**: The primary objective is to extract the titles of the content and their direct URLs. Additionally, capture the URL for the next page when applicable.
|
|
13
|
-
|
|
14
|
-
## Extraction Guidelines
|
|
15
|
-
1. **Title and URL**:
|
|
16
|
-
- Isolate and retrieve only the titles of the content and their respective URLs, excluding any site navigation elements, advertisements, or non-relevant content.
|
|
17
|
-
- Trim any superfluous whitespace surrounding the titles or URLs.
|
|
18
|
-
- Ensure all relevant URLs and titles are obtained, except those in ads or recommendation fields.
|
|
19
|
-
|
|
20
|
-
2. **Guideline for Locating Next Page**:
|
|
21
|
-
- Identify and include the URL for the next page of content, if such exists. Typically, these are associated with a number (2, 3, 4, etc.) or text such as "next page". **Do not** choose from other sources instead of leaving it blank.
|
|
22
|
-
- **Don't return any URLs that are not present in the text snapshot provided to you.**
|
|
23
|
-
- Look for hints indicating the last page, such as the absence of a "next page" link or a lack of URLs for any page number larger than the current page. If this is the case, return an empty string.
|
|
24
|
-
|
|
25
|
-
3. **Handling Exceptions**:
|
|
26
|
-
- If the text lacks identifiable content titles, return a specific error message: `"Error: No suitable content found."`
|
|
27
|
-
- Bypass any content URLs that redirect incorrectly (e.g., back to the homepage) instead of to the actual content.
|
|
28
|
-
|
|
29
|
-
4. **Output Presentation**:
|
|
30
|
-
- Format the extracted data as a JSON object.
|
|
31
|
-
- Use `titles_and_urls` as a key for an array of dictionaries, each containing a content's `title` and `url`.
|
|
32
|
-
- Maintain clarity and conciseness in listing titles and URLs.
|
|
33
|
-
- Include a `next_page` key with the URL to the next page of content if available; otherwise, leave this field empty.
|
|
34
|
-
- Ensure the URL to the next page is indeed a link to the next page.
|
|
35
|
-
|
|
36
|
-
**Example Output for Valid Webpage Content**:
|
|
37
|
-
|
|
38
|
-
```json
|
|
39
|
-
{
|
|
40
|
-
"titles_and_urls": [
|
|
41
|
-
{
|
|
42
|
-
"title": "Understanding Quantum Physics",
|
|
43
|
-
"url": "https://example.com/quantum-physics/"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"title": "The Basics of Machine Learning",
|
|
47
|
-
"url": "https://example.com/machine-learning-basics/"
|
|
48
|
-
}
|
|
49
|
-
// Additional content here
|
|
50
|
-
],
|
|
51
|
-
"next_page": ""
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
**Example Output for Invalid Webpage Content**:
|
|
56
|
-
|
|
57
|
-
```json
|
|
58
|
-
{
|
|
59
|
-
"error": "Error: No suitable content found."
|
|
60
|
-
}
|
|
61
|
-
```
|
|
62
|
-
```
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
### Notes: this meta-prompt is take from openai's documentation, the generated schema `a` is used like following: `client.chat.completions.create(..., tool = {"type": "function", "function": a}, ...)`
|
|
2
|
-
|
|
3
|
-
# Instructions
|
|
4
|
-
Return a valid schema for the described function.
|
|
5
|
-
|
|
6
|
-
Pay special attention to making sure that "required" and "type" are always at the correct level of nesting. For example, "required" should be at the same level as "properties", not inside it.
|
|
7
|
-
Make sure that every property, no matter how short, has a type and description correctly nested inside it.
|
|
8
|
-
|
|
9
|
-
# Examples
|
|
10
|
-
Input: Assign values to NN hyperparameters
|
|
11
|
-
Output: {
|
|
12
|
-
"name": "set_hyperparameters",
|
|
13
|
-
"description": "Assign values to NN hyperparameters",
|
|
14
|
-
"parameters": {
|
|
15
|
-
"type": "object",
|
|
16
|
-
"required": [
|
|
17
|
-
"learning_rate",
|
|
18
|
-
"epochs"
|
|
19
|
-
],
|
|
20
|
-
"properties": {
|
|
21
|
-
"epochs": {
|
|
22
|
-
"type": "number",
|
|
23
|
-
"description": "Number of complete passes through dataset"
|
|
24
|
-
},
|
|
25
|
-
"learning_rate": {
|
|
26
|
-
"type": "number",
|
|
27
|
-
"description": "Speed of model learning"
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
Input: Plans a motion path for the robot
|
|
34
|
-
Output: {
|
|
35
|
-
"name": "plan_motion",
|
|
36
|
-
"description": "Plans a motion path for the robot",
|
|
37
|
-
"parameters": {
|
|
38
|
-
"type": "object",
|
|
39
|
-
"required": [
|
|
40
|
-
"start_position",
|
|
41
|
-
"end_position"
|
|
42
|
-
],
|
|
43
|
-
"properties": {
|
|
44
|
-
"end_position": {
|
|
45
|
-
"type": "object",
|
|
46
|
-
"properties": {
|
|
47
|
-
"x": {
|
|
48
|
-
"type": "number",
|
|
49
|
-
"description": "End X coordinate"
|
|
50
|
-
},
|
|
51
|
-
"y": {
|
|
52
|
-
"type": "number",
|
|
53
|
-
"description": "End Y coordinate"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
"obstacles": {
|
|
58
|
-
"type": "array",
|
|
59
|
-
"description": "Array of obstacle coordinates",
|
|
60
|
-
"items": {
|
|
61
|
-
"type": "object",
|
|
62
|
-
"properties": {
|
|
63
|
-
"x": {
|
|
64
|
-
"type": "number",
|
|
65
|
-
"description": "Obstacle X coordinate"
|
|
66
|
-
},
|
|
67
|
-
"y": {
|
|
68
|
-
"type": "number",
|
|
69
|
-
"description": "Obstacle Y coordinate"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
"start_position": {
|
|
75
|
-
"type": "object",
|
|
76
|
-
"properties": {
|
|
77
|
-
"x": {
|
|
78
|
-
"type": "number",
|
|
79
|
-
"description": "Start X coordinate"
|
|
80
|
-
},
|
|
81
|
-
"y": {
|
|
82
|
-
"type": "number",
|
|
83
|
-
"description": "Start Y coordinate"
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
Input: Calculates various technical indicators
|
|
92
|
-
Output: {
|
|
93
|
-
"name": "technical_indicator",
|
|
94
|
-
"description": "Calculates various technical indicators",
|
|
95
|
-
"parameters": {
|
|
96
|
-
"type": "object",
|
|
97
|
-
"required": [
|
|
98
|
-
"ticker",
|
|
99
|
-
"indicators"
|
|
100
|
-
],
|
|
101
|
-
"properties": {
|
|
102
|
-
"indicators": {
|
|
103
|
-
"type": "array",
|
|
104
|
-
"description": "List of technical indicators to calculate",
|
|
105
|
-
"items": {
|
|
106
|
-
"type": "string",
|
|
107
|
-
"description": "Technical indicator",
|
|
108
|
-
"enum": [
|
|
109
|
-
"RSI",
|
|
110
|
-
"MACD",
|
|
111
|
-
"Bollinger_Bands",
|
|
112
|
-
"Stochastic_Oscillator"
|
|
113
|
-
]
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
"period": {
|
|
117
|
-
"type": "number",
|
|
118
|
-
"description": "Time period for the analysis"
|
|
119
|
-
},
|
|
120
|
-
"ticker": {
|
|
121
|
-
"type": "string",
|
|
122
|
-
"description": "Stock ticker symbol"
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
Given a task description or existing prompt, produce a detailed system prompt to guide a language model in completing the task effectively.
|
|
2
|
-
|
|
3
|
-
# Guidelines
|
|
4
|
-
|
|
5
|
-
- Understand the Task: Grasp the main objective, goals, requirements, constraints, and expected output.
|
|
6
|
-
- Minimal Changes: If an existing prompt is provided, improve it only if it's simple. For complex prompts, enhance clarity and add missing elements without altering the original structure.
|
|
7
|
-
- Reasoning Before Conclusions**: Encourage reasoning steps before any conclusions are reached. ATTENTION! If the user provides examples where the reasoning happens afterward, REVERSE the order! NEVER START EXAMPLES WITH CONCLUSIONS!
|
|
8
|
-
- Reasoning Order: Call out reasoning portions of the prompt and conclusion parts (specific fields by name). For each, determine the ORDER in which this is done, and whether it needs to be reversed.
|
|
9
|
-
- Conclusion, classifications, or results should ALWAYS appear last.
|
|
10
|
-
- Examples: Include high-quality examples if helpful, using placeholders [in brackets] for complex elements.
|
|
11
|
-
- What kinds of examples may need to be included, how many, and whether they are complex enough to benefit from placeholders.
|
|
12
|
-
- Clarity and Conciseness: Use clear, specific language. Avoid unnecessary instructions or bland statements.
|
|
13
|
-
- Formatting: Use markdown features for readability. DO NOT USE ``` CODE BLOCKS UNLESS SPECIFICALLY REQUESTED.
|
|
14
|
-
- Preserve User Content: If the input task or prompt includes extensive guidelines or examples, preserve them entirely, or as closely as possible. If they are vague, consider breaking down into sub-steps. Keep any details, guidelines, examples, variables, or placeholders provided by the user.
|
|
15
|
-
- Constants: DO include constants in the prompt, as they are not susceptible to prompt injection. Such as guides, rubrics, and examples.
|
|
16
|
-
- Output Format: Explicitly the most appropriate output format, in detail. This should include length and syntax (e.g. short sentence, paragraph, JSON, etc.)
|
|
17
|
-
- For tasks outputting well-defined or structured data (classification, JSON, etc.) bias toward outputting a JSON.
|
|
18
|
-
- JSON should never be wrapped in code blocks (```) unless explicitly requested.
|
|
19
|
-
|
|
20
|
-
The final prompt you output should adhere to the following structure below. Do not include any additional commentary, only output the completed system prompt. SPECIFICALLY, do not include any additional messages at the start or end of the prompt. (e.g. no "---")
|
|
21
|
-
|
|
22
|
-
[Concise instruction describing the task - this should be the first line in the prompt, no section header]
|
|
23
|
-
|
|
24
|
-
[Additional details as needed.]
|
|
25
|
-
|
|
26
|
-
[Optional sections with headings or bullet points for detailed steps.]
|
|
27
|
-
|
|
28
|
-
# Steps [optional]
|
|
29
|
-
|
|
30
|
-
[optional: a detailed breakdown of the steps necessary to accomplish the task]
|
|
31
|
-
|
|
32
|
-
# Output Format
|
|
33
|
-
|
|
34
|
-
[Specifically call out how the output should be formatted, be it response length, structure e.g. JSON, markdown, etc]
|
|
35
|
-
|
|
36
|
-
# Examples [optional]
|
|
37
|
-
|
|
38
|
-
[Optional: 1-3 well-defined examples with placeholders if necessary. Clearly mark where examples start and end, and what the input and output are. User placeholders as necessary.]
|
|
39
|
-
[If the examples are shorter than what a realistic example is expected to be, make a reference with () explaining how real examples should be longer / shorter / different. AND USE PLACEHOLDERS! ]
|
|
40
|
-
|
|
41
|
-
# Notes [optional]
|
|
42
|
-
|
|
43
|
-
[optional: edge cases, details, and an area to call or repeat out specific important considerations]
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
### Additional requirements:
|
|
47
|
-
|
|
48
|
-
Here lists the additional requirement for costumization.
|
|
49
|
-
* The format of the placeholder must be <<<placeholder>>>, with 'placeholder' text changed to appropriate names.
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "Biomedical_NER_Extractor",
|
|
3
|
-
"schema": {
|
|
4
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"additionalProperties": false,
|
|
7
|
-
"properties": {
|
|
8
|
-
"sentences": {
|
|
9
|
-
"type": "array",
|
|
10
|
-
"items": {
|
|
11
|
-
"type": "object",
|
|
12
|
-
"properties": {
|
|
13
|
-
"text": {
|
|
14
|
-
"type": "string",
|
|
15
|
-
"description": "The original sentence from which entities are extracted."
|
|
16
|
-
},
|
|
17
|
-
"entities": {
|
|
18
|
-
"type": "array",
|
|
19
|
-
"items": {
|
|
20
|
-
"type": "string",
|
|
21
|
-
"description": "Named entities identified in the sentence."
|
|
22
|
-
},
|
|
23
|
-
"description": "List of extracted entities from the sentence."
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"required": [
|
|
27
|
-
"text",
|
|
28
|
-
"entities"
|
|
29
|
-
]
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
"required": [
|
|
34
|
-
"sentences"
|
|
35
|
-
]
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "entity_extraction_per_sentence",
|
|
3
|
-
"type": "object",
|
|
4
|
-
"properties": {
|
|
5
|
-
"sentences": {
|
|
6
|
-
"type": "array",
|
|
7
|
-
"description": "A list of sentences with their extracted entities.",
|
|
8
|
-
"items": {
|
|
9
|
-
"$ref": "#/$defs/sentence"
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"required": [
|
|
14
|
-
"sentences"
|
|
15
|
-
],
|
|
16
|
-
"additionalProperties": false,
|
|
17
|
-
"$defs": {
|
|
18
|
-
"sentence": {
|
|
19
|
-
"type": "object",
|
|
20
|
-
"description": "An input sentence and the entities found in it.",
|
|
21
|
-
"properties": {
|
|
22
|
-
"text": {
|
|
23
|
-
"type": "string",
|
|
24
|
-
"description": "The original sentence text."
|
|
25
|
-
},
|
|
26
|
-
"entities": {
|
|
27
|
-
"type": "array",
|
|
28
|
-
"description": "List of extracted entities for this sentence.",
|
|
29
|
-
"items": {
|
|
30
|
-
"$ref": "#/$defs/entity"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"required": [
|
|
35
|
-
"text",
|
|
36
|
-
"entities"
|
|
37
|
-
],
|
|
38
|
-
"additionalProperties": false
|
|
39
|
-
},
|
|
40
|
-
"entity": {
|
|
41
|
-
"type": "object",
|
|
42
|
-
"description": "A single extracted entity with its label.",
|
|
43
|
-
"properties": {
|
|
44
|
-
"text": {
|
|
45
|
-
"type": "string",
|
|
46
|
-
"description": "Surface form of the entity as it appears in the sentence."
|
|
47
|
-
},
|
|
48
|
-
"label": {
|
|
49
|
-
"type": "string",
|
|
50
|
-
"description": "The entity label; must be one of the allowed labels.",
|
|
51
|
-
"enum": [
|
|
52
|
-
"PERSON",
|
|
53
|
-
"ORG",
|
|
54
|
-
"LOCATION",
|
|
55
|
-
"GPE",
|
|
56
|
-
"FACILITY",
|
|
57
|
-
"EVENT",
|
|
58
|
-
"WORK_OF_ART",
|
|
59
|
-
"LAW",
|
|
60
|
-
"LANGUAGE",
|
|
61
|
-
"PRODUCT",
|
|
62
|
-
"SOFTWARE",
|
|
63
|
-
"DATASET",
|
|
64
|
-
"TECHNOLOGY",
|
|
65
|
-
"SCIENTIFIC_TERM",
|
|
66
|
-
"METHOD",
|
|
67
|
-
"CONCEPT",
|
|
68
|
-
"TOPIC",
|
|
69
|
-
"FIELD",
|
|
70
|
-
"MEASURE",
|
|
71
|
-
"QUANTITY",
|
|
72
|
-
"PERCENT",
|
|
73
|
-
"MONEY",
|
|
74
|
-
"VALUE",
|
|
75
|
-
"DATE",
|
|
76
|
-
"TIME",
|
|
77
|
-
"DURATION",
|
|
78
|
-
"DOCUMENT",
|
|
79
|
-
"URL",
|
|
80
|
-
"ID",
|
|
81
|
-
"OTHER"
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
"required": [
|
|
86
|
-
"text",
|
|
87
|
-
"label"
|
|
88
|
-
],
|
|
89
|
-
"additionalProperties": false
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
POP/Embedder.py,sha256=KSqneJNdpkE5_b82AHhpXRXAD9DYt9bads6oMcvDIoM,10165
|
|
2
|
-
POP/LLMClient.py,sha256=gFEDUaLba_G0nlpS9qj-ajDhryDuBDztPPF3qhQG7Vg,15449
|
|
3
|
-
POP/POP.py,sha256=b99m3kq298QldMm-Zv09ov2LoJL6n-aG3Z0CRC8dQps,15936
|
|
4
|
-
POP/__init__.py,sha256=aHsN8USyF18G_8Pr3h49SClWywy0y1h5-63u_OSXBQM,429
|
|
5
|
-
POP/prompts/2024-11-19-content_finder.md,sha256=ncMkvL6xUgYDhSXEPGTw5rnYF3b2Gq1nRyAVdaLaNGA,2238
|
|
6
|
-
POP/prompts/2024-11-19-get_content.md,sha256=vQhkGBX5Doj4vsCIfAmGyLwl0f7wHw0TkEJE3wFBdxY,3530
|
|
7
|
-
POP/prompts/2024-11-19-get_title_and_url.md,sha256=s_H5g0ZwOcRAt1hi9EBc8gYzf3W-lWMk3QVmd_byMjM,2881
|
|
8
|
-
POP/prompts/CLI_AI_helper.md,sha256=TJCu_tmjw3QLET5ArT_tDZ7is-nOZT55uAir9HxAIug,3561
|
|
9
|
-
POP/prompts/content_finder.md,sha256=_vpQ6hx5kdkNREPSVcYzW_AIV9tjy0p8xowenyzKOog,1735
|
|
10
|
-
POP/prompts/corpus_splitter.md,sha256=Nv_2J4YpxT9MNPx7M53DNzQpZq8skWnRXYkLWEaDbXE,1735
|
|
11
|
-
POP/prompts/fabric-improve_prompt.md,sha256=McipYmKSBHRwOr8xTHZOO3h39bCTULgoddOjMXtYvds,34777
|
|
12
|
-
POP/prompts/function_code_generator.md,sha256=PpT8WJ7GvOoBOBH5o-u9cSD_QAirNXeerlt6RUS5m74,1723
|
|
13
|
-
POP/prompts/function_description_generator.md,sha256=4EuZRAimvdpSWeWhlOV0vRyaRJqU2kJLdWj2MboSGHg,1250
|
|
14
|
-
POP/prompts/get_content.md,sha256=hrrgcTHDUfOwe4dd74EJ9S2-QimgOZKW7vaqTXhhitQ,3741
|
|
15
|
-
POP/prompts/get_title_and_url.md,sha256=uPl1RicBQRkcy2D-fhd8G4OZDUYhJOYYhJvbLpV2gk4,2901
|
|
16
|
-
POP/prompts/json_formatter_prompt.md,sha256=64UG19TegJPcy3tNO1XjmrdXhomSucnrkUOkK9wJQH4,1565
|
|
17
|
-
POP/prompts/openai-function_description_generator.md,sha256=fRgPeNH9Y-BuZRr7uLFlYa8__V5I7aRHsos4q7xsJRc,4056
|
|
18
|
-
POP/prompts/openai-json_schema_generator.md,sha256=5N8D3qm5UPqjZNqLYmDhwlCc1GeYHgJER_eqVsBmxcE,5220
|
|
19
|
-
POP/prompts/openai-prompt_generator.md,sha256=drMW9fSZUN8ldwNrvc_YsHDiSbwB58jonVSxdgydDro,3645
|
|
20
|
-
POP/schemas/biomedical_ner_extractor.json,sha256=WbWWWypvDdrHLvoFcEaCXa8Mx_FvmKLqUtYs2GWZujQ,929
|
|
21
|
-
POP/schemas/entity_extraction_per_sentence.json,sha256=S9g4pL_LOc36fNM-PA33kRNGEvKQYPe3GpHBrozwbdc,2149
|
|
22
|
-
pop_python-1.0.3.dist-info/licenses/LICENSE,sha256=zm0TNFsVPrnSK7IDoO504aeYMnO69QrL9IY9P5jRHHg,1064
|
|
23
|
-
pop_python-1.0.3.dist-info/METADATA,sha256=nE8u_YyUZWRFWoGGNh66wj1Nm48WtvAQG9ZSmyEbbiI,7033
|
|
24
|
-
pop_python-1.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
25
|
-
pop_python-1.0.3.dist-info/top_level.txt,sha256=n_VDHKZJpAKLhVprDjVofH0AgoRlb1y_uO3aRHNmNyo,4
|
|
26
|
-
pop_python-1.0.3.dist-info/RECORD,,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
POP
|
|
File without changes
|