initial commit
Browse files- GPT4Flow.py +12 -0
- GPT4Flow.yaml +57 -0
- __init__.py +1 -0
GPT4Flow.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dependencies = [
|
| 2 |
+
{"url": "martinjosifoski/OpenAIChatAtomicFlow", "revision": "main"},
|
| 3 |
+
]
|
| 4 |
+
from flows import flow_verse
|
| 5 |
+
flow_verse.sync_dependencies(dependencies)
|
| 6 |
+
|
| 7 |
+
from flow_modules.martinjosifoski.OpenAIChatAtomicFlow import OpenAIChatAtomicFlow
|
| 8 |
+
|
| 9 |
+
class GPT4Flow(OpenAIChatAtomicFlow):
|
| 10 |
+
def __init__(self, **kwargs):
|
| 11 |
+
super().__init__(**kwargs)
|
| 12 |
+
|
GPT4Flow.yaml
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: "GPT4Flow"
|
| 2 |
+
description: "A General OpenAI GPT4 Chatbot implemented as an AtomicFlow"
|
| 3 |
+
|
| 4 |
+
model_name: "gpt-4"
|
| 5 |
+
generation_parameters:
|
| 6 |
+
n: 1
|
| 7 |
+
max_tokens: 3000
|
| 8 |
+
temperature: 0.3
|
| 9 |
+
|
| 10 |
+
model_kwargs:
|
| 11 |
+
top_p: 0.2
|
| 12 |
+
frequency_penalty: 0
|
| 13 |
+
presence_penalty: 0
|
| 14 |
+
|
| 15 |
+
system_message_prompt_template:
|
| 16 |
+
_target_: langchain.PromptTemplate
|
| 17 |
+
template: |2-
|
| 18 |
+
You are a helpful assistant.
|
| 19 |
+
|
| 20 |
+
input_variables: []
|
| 21 |
+
template_format: jinja2
|
| 22 |
+
|
| 23 |
+
human_message_prompt_template:
|
| 24 |
+
_target_: langchain.PromptTemplate
|
| 25 |
+
template: "{{query}}"
|
| 26 |
+
input_variables:
|
| 27 |
+
- "query"
|
| 28 |
+
template_format: jinja2
|
| 29 |
+
|
| 30 |
+
query_message_prompt_template:
|
| 31 |
+
_target_: langchain.PromptTemplate
|
| 32 |
+
template: |2-
|
| 33 |
+
{{query}}
|
| 34 |
+
|
| 35 |
+
input_variables:
|
| 36 |
+
- "query" # # "human_input"
|
| 37 |
+
template_format: jinja2
|
| 38 |
+
|
| 39 |
+
keep_raw_response: False
|
| 40 |
+
|
| 41 |
+
output_data_transformations:
|
| 42 |
+
- _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
|
| 43 |
+
regex: '(.*)'
|
| 44 |
+
input_key: "raw_response"
|
| 45 |
+
output_key: "response"
|
| 46 |
+
strip: True
|
| 47 |
+
assert_unique: True
|
| 48 |
+
verbose: False
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
input_keys:
|
| 52 |
+
- "query" # "human_input"
|
| 53 |
+
|
| 54 |
+
output_keys:
|
| 55 |
+
- "response"
|
| 56 |
+
|
| 57 |
+
|
__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
from .GPT4Flow import GPT4Flow
|