Skip to content

Commit 06f3991

Browse files
committed
Update GenerativeModel.cs
1 parent 8228574 commit 06f3991

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

vertexai/src/GenerativeModel.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17+
// For now, using this to hide some functions causing problems with the build.
18+
#define HIDE_IASYNCENUMERABLE
19+
1720
using System;
1821
using System.Collections.Generic;
1922
using System.Linq;
@@ -100,8 +103,7 @@ public Task<GenerateContentResponse> GenerateContentAsync(
100103
return GenerateContentAsyncInternal(content);
101104
}
102105

103-
#define HIDE_IASYNCENUMERABLE
104-
#if !defined(HIDE_IASYNCENUMERABLE)
106+
#if !HIDE_IASYNCENUMERABLE
105107
public IAsyncEnumerable<GenerateContentResponse> GenerateContentStreamAsync(
106108
params ModelContent[] content) {
107109
return GenerateContentStreamAsync((IEnumerable<ModelContent>)content);
@@ -163,7 +165,7 @@ private async Task<GenerateContentResponse> GenerateContentAsyncInternal(
163165
return GenerateContentResponse.FromJson(result);
164166
}
165167

166-
#if !defined(HIDE_IASYNCENUMERABLE)
168+
#if !HIDE_IASYNCENUMERABLE
167169
private async IAsyncEnumerable<GenerateContentResponse> GenerateContentStreamAsyncInternal(
168170
IEnumerable<ModelContent> content) {
169171
// TODO: Implementation
@@ -188,12 +190,11 @@ private string GetURL() {
188190
}
189191

190192
private string ModelContentsToJson(IEnumerable<ModelContent> contents) {
191-
Dictionary<string, object> jsonDict = new()
192-
{
193+
Dictionary<string, object> jsonDict = new() {
193194
// Convert the Contents into a list of Json dictionaries
194195
["contents"] = contents.Select(c => c.ToJson()).ToList()
195-
// TODO: All the other settings
196196
};
197+
// TODO: All the other settings
197198

198199
return Json.Serialize(jsonDict);
199200
}

0 commit comments

Comments
 (0)