-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from johnoliver/format
Apply code formatting rules defined in spotless
- Loading branch information
Showing
50 changed files
with
2,793 additions
and
2,552 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 45 additions & 45 deletions
90
app/backend/src/main/java/com/microsoft/openai/samples/rag/approaches/ContentSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
package com.microsoft.openai.samples.rag.approaches; | ||
|
||
public class ContentSource { | ||
|
||
private String sourceName; | ||
private String sourceContent; | ||
private final boolean noNewLine; | ||
|
||
public ContentSource(String sourceName, String sourceContent, Boolean noNewLine) { | ||
this.noNewLine = noNewLine; | ||
this.sourceName = sourceName; | ||
buildContent(sourceContent); | ||
} | ||
|
||
public ContentSource(String sourceName, String sourceContent) { | ||
this(sourceName, sourceContent, true); | ||
} | ||
|
||
public String getSourceName() { | ||
return sourceName; | ||
} | ||
|
||
public void setSourceName(String sourceName) { | ||
this.sourceName = sourceName; | ||
} | ||
|
||
public String getSourceContent() { | ||
return sourceContent; | ||
} | ||
|
||
public void setSourceContent(String sourceContent) { | ||
this.sourceContent = sourceContent; | ||
} | ||
|
||
public boolean isNoNewLine() { | ||
return noNewLine; | ||
} | ||
|
||
private void buildContent(String sourceContent) { | ||
if (this.noNewLine) { | ||
this.sourceContent = sourceContent.replace("\n", ""); | ||
} | ||
} | ||
|
||
} | ||
// Copyright (c) Microsoft. All rights reserved. | ||
package com.microsoft.openai.samples.rag.approaches; | ||
|
||
public class ContentSource { | ||
|
||
private String sourceName; | ||
private String sourceContent; | ||
private final boolean noNewLine; | ||
|
||
public ContentSource(String sourceName, String sourceContent, Boolean noNewLine) { | ||
this.noNewLine = noNewLine; | ||
this.sourceName = sourceName; | ||
buildContent(sourceContent); | ||
} | ||
|
||
public ContentSource(String sourceName, String sourceContent) { | ||
this(sourceName, sourceContent, true); | ||
} | ||
|
||
public String getSourceName() { | ||
return sourceName; | ||
} | ||
|
||
public void setSourceName(String sourceName) { | ||
this.sourceName = sourceName; | ||
} | ||
|
||
public String getSourceContent() { | ||
return sourceContent; | ||
} | ||
|
||
public void setSourceContent(String sourceContent) { | ||
this.sourceContent = sourceContent; | ||
} | ||
|
||
public boolean isNoNewLine() { | ||
return noNewLine; | ||
} | ||
|
||
private void buildContent(String sourceContent) { | ||
if (this.noNewLine) { | ||
this.sourceContent = sourceContent.replace("\n", ""); | ||
} | ||
} | ||
} |
18 changes: 9 additions & 9 deletions
18
app/backend/src/main/java/com/microsoft/openai/samples/rag/approaches/PromptTemplate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
package com.microsoft.openai.samples.rag.approaches; | ||
|
||
public interface PromptTemplate { | ||
|
||
String getPrompt(); | ||
|
||
void setVariables(); | ||
|
||
} | ||
// Copyright (c) Microsoft. All rights reserved. | ||
package com.microsoft.openai.samples.rag.approaches; | ||
|
||
public interface PromptTemplate { | ||
|
||
String getPrompt(); | ||
|
||
void setVariables(); | ||
} |
23 changes: 11 additions & 12 deletions
23
app/backend/src/main/java/com/microsoft/openai/samples/rag/approaches/RAGApproach.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
package com.microsoft.openai.samples.rag.approaches; | ||
|
||
import com.microsoft.openai.samples.rag.common.ChatGPTConversation; | ||
import reactor.core.publisher.Flux; | ||
|
||
import java.io.OutputStream; | ||
|
||
public interface RAGApproach<I, O> { | ||
|
||
O run(I questionOrConversation, RAGOptions options); | ||
void runStreaming(I questionOrConversation, RAGOptions options, OutputStream outputStream); | ||
} | ||
// Copyright (c) Microsoft. All rights reserved. | ||
package com.microsoft.openai.samples.rag.approaches; | ||
|
||
import java.io.OutputStream; | ||
|
||
public interface RAGApproach<I, O> { | ||
|
||
O run(I questionOrConversation, RAGOptions options); | ||
|
||
void runStreaming(I questionOrConversation, RAGOptions options, OutputStream outputStream); | ||
} |
2 changes: 1 addition & 1 deletion
2
...backend/src/main/java/com/microsoft/openai/samples/rag/approaches/RAGApproachFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
package com.microsoft.openai.samples.rag.approaches; | ||
|
||
public interface RAGApproachFactory<I, O> { | ||
|
||
RAGApproach<I, O> createApproach(String approachName, RAGType ragType, RAGOptions options); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.