File tree 6 files changed +63
-9
lines changed
6 files changed +63
-9
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,6 @@ $ docker run --rm -p 1416:1416 -v $PWD/pipelines:/opt/pipelines "deepset/hayhook
167
167
At this stage Hayhooks is just a prototype, the natural next steps would be:
168
168
169
169
- Improve server configuration management (easy)
170
- - Add CLI configuration profiles, so it's easy to address different servers (easy)
171
170
- Manage pipeline dependencies: one way could be adding the required packages in the pipeline's metadata and let the
172
171
server handle installation (complex)
173
172
Original file line number Diff line number Diff line change 11
11
12
12
@click .group (context_settings = {"help_option_names" : ["-h" , "--help" ]}, invoke_without_command = True )
13
13
@click .version_option (prog_name = "Hayhooks" )
14
- def hayhooks ():
15
- pass
14
+ @click .option ('--server' , default = "http://localhost:1416" )
15
+ @click .pass_context
16
+ def hayhooks (ctx , server ):
17
+ ctx .obj = server
16
18
17
19
18
20
hayhooks .add_command (run )
Original file line number Diff line number Diff line change 5
5
6
6
7
7
@click .command ()
8
+ @click .pass_obj
8
9
@click .option ('-n' , '--name' )
9
10
@click .argument ('pipeline_file' , type = click .File ('r' ))
10
- def deploy (name , pipeline_file ):
11
+ def deploy (server , name , pipeline_file ):
11
12
if name is None :
12
13
name = Path (pipeline_file .name ).stem
13
- resp = requests .post ("http://localhost:1416 /deploy" , json = {"name" : name , "source_code" : str (pipeline_file .read ())})
14
+ resp = requests .post (f" { server } /deploy" , json = {"name" : name , "source_code" : str (pipeline_file .read ())})
14
15
15
16
if resp .status_code >= 400 :
16
17
click .echo (f"Error deploying pipeline: { resp .json ().get ('detail' )} " )
Original file line number Diff line number Diff line change 4
4
5
5
6
6
@click .command ()
7
- def status ():
7
+ @click .pass_obj
8
+ def status (server ):
8
9
try :
9
- r = requests .get ("http://localhost:1416 /status" )
10
+ r = requests .get (f" { server } /status" )
10
11
except ConnectionError :
11
12
click .echo ("Hayhooks server is not responding. To start one, run `hayooks run`" )
12
13
return
Original file line number Diff line number Diff line change 6
6
7
7
8
8
@click .command ()
9
+ @click .pass_obj
9
10
@click .argument ('pipeline_name' )
10
- def undeploy (pipeline_name ):
11
+ def undeploy (server , pipeline_name ):
11
12
try :
12
- resp = requests .post (f"http://localhost:1416 /undeploy/{ pipeline_name } " )
13
+ resp = requests .post (f"{ server } /undeploy/{ pipeline_name } " )
13
14
14
15
if resp .status_code >= 400 :
15
16
click .echo (f"Cannot undeploy pipeline: { resp .json ().get ('detail' )} " )
Original file line number Diff line number Diff line change
1
+ components :
2
+ converter :
3
+ init_parameters :
4
+ extractor_type : DefaultExtractor
5
+ type : haystack.components.converters.html.HTMLToDocument
6
+
7
+ fetcher :
8
+ init_parameters :
9
+ raise_on_failure : true
10
+ retry_attempts : 2
11
+ timeout : 3
12
+ user_agents :
13
+ - haystack/LinkContentFetcher/2.0.0b8
14
+ type : haystack.components.fetchers.link_content.LinkContentFetcher
15
+
16
+ llm :
17
+ init_parameters :
18
+ api_base_url : null
19
+ api_key :
20
+ env_vars :
21
+ - OPENAI_API_KEY
22
+ strict : true
23
+ type : env_var
24
+ generation_kwargs : {}
25
+ model : gpt-3.5-turbo
26
+ streaming_callback : null
27
+ system_prompt : null
28
+ type : haystack.components.generators.openai.OpenAIGenerator
29
+
30
+ prompt :
31
+ init_parameters :
32
+ template : |
33
+ "According to the contents of this website:
34
+ {% for document in documents %}
35
+ {{document.content}}
36
+ {% endfor %}
37
+ Answer the given question: {{query}}
38
+ Answer:
39
+ "
40
+ type : haystack.components.builders.prompt_builder.PromptBuilder
41
+
42
+ connections :
43
+ - receiver : converter.sources
44
+ sender : fetcher.streams
45
+ - receiver : prompt.documents
46
+ sender : converter.documents
47
+ - receiver : llm.prompt
48
+ sender : prompt.prompt
49
+
50
+ metadata : {}
You can’t perform that action at this time.
0 commit comments